Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ping tool exports prometheus metrics #8023

Merged
merged 418 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
418 commits
Select commit Hold shift + click to select a range
776eb1f
chore: Update a couple of more crates to 1.64 (#7688)
akhi3030 Sep 26, 2022
7920351
feat: always display uncertain estimation warnings (#7690)
jakmeier Sep 26, 2022
046bd14
chore: Use inheritance to reduce copy-paste in `Cargo.toml`s (#7687)
akhi3030 Sep 26, 2022
46a9acf
Fix upgradable.py db migration flags too; like #7607 (#7694)
robin-near Sep 26, 2022
600887b
Implement FlatStorageState (#7663)
mzhangmzz Sep 26, 2022
662aaa9
Remove DBCol::ChunkPerHeightShard (#7671)
robin-near Sep 26, 2022
ab27e8e
fix: logo URL in README.md (#7696)
jakmeier Sep 27, 2022
3fa9584
Upgrade tracing and opentelemetry crates (#7691)
nikurt Sep 27, 2022
fdefee7
chore: remove unused dependency (#7699)
matklad Sep 27, 2022
8d3ce0a
fix: do not block on prefetcher (#7700)
jakmeier Sep 27, 2022
81b8035
fix(mocknet): Don't report mocknet telemetry to the mainnet explorer …
nikurt Sep 27, 2022
cfbbeb7
refactor: remove unneeded check in themis (#7697)
akhi3030 Sep 27, 2022
463d39e
Update rand dependency to latest 0.8.5 version (#7705)
mina86 Sep 27, 2022
c4117cf
doc: move wiki contents over to the book (#7706)
matklad Sep 27, 2022
f79ad4e
Use workspace inheritance to specify versions of dependencies (#7703)
mina86 Sep 27, 2022
c625afe
themis: publishable crates shouldn't depend on non-publishable ones (…
miraclx Sep 27, 2022
861ac4e
refactor: move shard_layout_from_prev_block to EMA (#7673)
matklad Sep 28, 2022
9d8f185
feat(o11y): Configure opentelemetry filter at runtime (#7701)
nikurt Sep 28, 2022
1299199
fix: create FlatStorageState inside RuntimeAdapter (#7710)
Longarithm Sep 28, 2022
05d5b7b
Use the underlying reproducible random impls instead of StdRng. (#7717)
robin-near Sep 28, 2022
c60196e
chore(ci): Updated the error message that themis would display when p…
frol Sep 29, 2022
9e26a1a
fix: properly stop prefetching background threads (#7712)
jakmeier Sep 29, 2022
6c0b3c2
Merged network-primitives into network package (#7722)
pompon0 Sep 29, 2022
bdf948f
feat(rosetta-rpc): Add Metadata tagging fee-related Operations (#7704)
frol Sep 29, 2022
c0a7ee4
docs: inline docs for cross_shard_tx testing infra (#7715)
matklad Sep 29, 2022
8e1329e
refactor: move account to shard uid to EpochManagerHandle (#7716)
matklad Sep 29, 2022
faff5a0
refactor: simplify get_epoch_sync_data_hash (#7726)
matklad Sep 29, 2022
ce1becb
[chunks] Move ChainStore use out of ShardsManager and into the Client…
robin-near Sep 29, 2022
243817a
Fix: typos (#7734)
omahs Sep 30, 2022
9448356
store: refactor handling of database migration (#7584)
mina86 Sep 30, 2022
1436781
doc: get rid of useless src folder (#7736)
matklad Sep 30, 2022
00e72df
Update rocksdb to 0.19 (#7357) (#7731)
mina86 Sep 30, 2022
d0f74fa
fix: correct #7667 (#7730)
matklad Sep 30, 2022
b877a5f
doc: Document the tracking issue process (#7713)
akhi3030 Sep 30, 2022
55e5c37
Avoid Vec allocations where slice suffices (#7740)
mina86 Sep 30, 2022
d2443a6
fix: typo (#7748)
dbajramo Oct 1, 2022
cde4264
pytest: fix Rosetta test after addition of transfer_fee_type (#7747)
mina86 Oct 3, 2022
9b92f1e
integration-tests: enable test_tps_regression::test_highload expensiv…
mina86 Oct 3, 2022
bcc1329
store: stop TrieUpdateIterator after error is encountered (#7743)
mina86 Oct 3, 2022
65719b5
feat(o11y): Export basic node config values as static opentelemetry a…
nikurt Oct 3, 2022
b1a9b4f
store: introduce StoreUpdateStorage to StoreUpdate (#7742)
mina86 Oct 3, 2022
c348456
docs: refresh CONTRIBUTING.md (#7753)
matklad Oct 3, 2022
78b4309
fix: compare head heights before updating flat storage (#7724)
Longarithm Oct 3, 2022
43cb28b
store: delete contents of GCCount when doing 31→32 database migration…
mina86 Oct 3, 2022
4cef345
chore: ensure that rust-toolcahin and Cargo.toml rust-versions are co…
matklad Oct 3, 2022
89c9e8d
view_client: remove confusing comment about ‘legacy support’ around T…
mina86 Oct 3, 2022
a608cf4
changelog: add 1.29.0 changes (#7754)
marcelo-gonzalez Oct 3, 2022
e815608
doc: move build optimization content from wiki into internal docs (#7…
matklad Oct 4, 2022
8d72c90
Add information about chunk producer and block timestamp to state-vie…
mm-near Oct 4, 2022
897e700
fix: race condition in rpctypegen macro (#7763)
matklad Oct 4, 2022
22008d9
nearcore: don’t serialise `archive` if false (#7764)
mina86 Oct 4, 2022
8577da9
fix: broken pytest (#7765)
matklad Oct 4, 2022
4998d31
enabled TIER1 peer discovery in all envs (#7759)
pompon0 Oct 4, 2022
0a473e5
fix: disallowed loop connections (#7719)
pompon0 Oct 4, 2022
6e8b5d4
core: add simple unit test for CryptoHash::hash_borsh and hash_borsh_…
mina86 Oct 4, 2022
5050550
doc: fix typo in store/src/lib.rs (#7775)
nujabes403 Oct 5, 2022
335d7d5
chain: avoid unnecessary String allocation in store_validator (#7770)
mina86 Oct 5, 2022
ff32a47
store: introduce CompiledContractCache::has to avoid data cloning (#7…
mina86 Oct 5, 2022
0470bc8
store: move TrieIterator to separate module (#7772)
mina86 Oct 5, 2022
074818f
feat: gc deltas and block infos from flat storage (#7768)
Longarithm Oct 6, 2022
e080d6f
runtime-params-estimator: remove unused walrus dependency (#7786)
mina86 Oct 6, 2022
14f7b1f
feat(o11y): Disable span events in logs by default (#7762)
nikurt Oct 6, 2022
bf48d82
feat: discard non-finalizable blocks (#7746)
Longarithm Oct 7, 2022
cc5c9e5
doc: fix typo in chain/indexer/src/streamer/mod.rs (#7776)
nujabes403 Oct 10, 2022
4ebd70f
doc: remove obsolete metrics docs (#7728)
matklad Oct 10, 2022
75fa97a
runtime: prefer block_height field name and remove obsolete TODOs (#7…
mina86 Oct 10, 2022
37d91a2
doc: fix typo sing -> sign (#7794)
nujabes403 Oct 10, 2022
81768a5
feat(o11y): Attach tracing context to ClientActor work items (#7773)
nikurt Oct 10, 2022
d399c88
pytest: fix tests after archive flag changes (#7793)
mina86 Oct 10, 2022
29fa1ee
store: move borsh into CompiledContractCache (#7787)
mina86 Oct 10, 2022
31c4e61
[chunks] Move tx_pool out of ShardsManager. (#7783)
robin-near Oct 10, 2022
28043d1
[chunks] Move chain_head maintenance into ShardsManager (#7784)
robin-near Oct 10, 2022
4e242eb
core: introduce CryptoHash::hash_borsh_iter method (#7771)
mina86 Oct 10, 2022
3d4ab75
Remove deepsize dependency (#7796)
mina86 Oct 10, 2022
58ad51f
Revert "json: remove deprecated old style path+data request format" (…
mina86 Oct 10, 2022
2ac0961
fix: adjust behaviour of chunk nodes cache test (#7798)
Longarithm Oct 11, 2022
cde615c
add sync_height_threshold to config (#7805)
posvyatokum Oct 11, 2022
14b174e
fix: failing mock node test for flat state (#7801)
Longarithm Oct 11, 2022
1cea6e0
store: simplify RocksDB::iter, iter_prefix and iter_raw_bytes (#7803)
mina86 Oct 11, 2022
2e10319
near-vm-logic: remove unused bs58 dependency (#7802)
mina86 Oct 11, 2022
4f1e568
o11y: introduce Bytes to format binary data in a smart way (#7781)
mina86 Oct 11, 2022
5c35d2c
doc: freshen architecture overview (#7766)
matklad Oct 11, 2022
5c647f3
Flat storage: fix two tests around state sync and block catchup (#7789)
mzhangmzz Oct 12, 2022
bef3835
[chunks] Fix bug that produced partial chunks were not inserted into …
robin-near Oct 12, 2022
80f6f33
store: flatten TransactionResult column to remove need for RMW (#7799)
robin-near Oct 12, 2022
1ce8ac0
core: accept passing arguments by value in CryptoHash::hash_bytes (#7…
mina86 Oct 12, 2022
5972e98
chore: remove obsolete license (#7729)
matklad Oct 13, 2022
cf5e9e4
doc: fix typo treasure -> treasury (#7823)
nujabes403 Oct 13, 2022
d3f034b
moved connection::Connection to PeerStatus (#7778)
pompon0 Oct 13, 2022
ff8db50
doc: start moving "how neard works" to docs (#7824)
matklad Oct 13, 2022
efe9a6e
refactor: split guest aborts / runtime errors (#7815)
jakmeier Oct 13, 2022
720b0b5
doc: move GC docs over from confluence (#7826)
matklad Oct 13, 2022
41273bd
core: change PROTOCOL_UPGRADE_SCHEDULE into a single value (#7830)
mina86 Oct 14, 2022
23a42a6
refactor: remove dead code (#7814)
matklad Oct 14, 2022
a4ae918
Fuzz the running releases (#7833)
Ekleog-NEAR Oct 14, 2022
48a3bfb
[TransactionResult] Avoid panicing if original column had duplicate e…
robin-near Oct 14, 2022
37c9859
docs: move epoch docs from confluence (#7838)
matklad Oct 17, 2022
7f97723
docs: move sync docs from confluence (#7837)
matklad Oct 17, 2022
a39445b
nearcore: run node in archival mode if database is an archive (#7752)
mina86 Oct 17, 2022
3bdd2b9
client: add {node,validator}_public_key field to /status response; de…
mina86 Oct 17, 2022
07531a0
fix(o11y): Write all logs to stderr (#7834)
nikurt Oct 17, 2022
61961e2
refactor: move get_validator_info to EpochManagerAdapter (#7727)
matklad Oct 17, 2022
c90a542
chain: don’t clone Store in RuntimeAdapter::get_store (#7841)
mina86 Oct 17, 2022
08e67c1
docs: move transaction routing from confluence (#7850)
matklad Oct 17, 2022
d53122b
refactor: move `UnsupportedCompiler` to errors (#7849)
jakmeier Oct 17, 2022
4b10d69
Introduce database kind (#7756)
mina86 Oct 17, 2022
79387ff
nit: fix mixed up info log on chain init (#7853)
marcelo-gonzalez Oct 17, 2022
2731e7d
refactor: don't lose underlying io::Error in CacheError (#7852)
matklad Oct 18, 2022
75e0896
fix: make non-integration tests work with flat storage (#7816)
Longarithm Oct 18, 2022
1167616
chain: reuse more types in JSON RPC fuzzer (#7782)
mina86 Oct 18, 2022
2eb3a51
feat: Replay IO traces on estimator for statistics (#7445)
jakmeier Oct 18, 2022
f21e049
Trace context for the following actors: (#7819)
nikurt Oct 18, 2022
1c45380
doc: fix typo 'orphan' (#7862)
nujabes403 Oct 18, 2022
3dddc04
doc: fix typo in chain/rosetta-rpc/src/lib.rs (#7777)
nujabes403 Oct 18, 2022
fa988cf
refactor: streamline contract caching code (#7851)
matklad Oct 18, 2022
00338e6
Extracted client API in near_network. (#7839)
pompon0 Oct 18, 2022
aa82ba4
jsonrpc: check base58 length limit before the whole buffer is decoded…
mina86 Oct 19, 2022
abc5bee
chore: remove FunctionCallError::_EVMError (#7873)
jakmeier Oct 19, 2022
270ab43
store: remove unused version.rs file (#7867)
mina86 Oct 19, 2022
be17d53
Fix/Rosetta Rpc predecessor_id on each state change (#7576)
firatNEAR Oct 19, 2022
0f2a3cb
feat(o11y): Attach tracing context to messages received by PeerManage…
nikurt Oct 19, 2022
2bb6567
chain: added `near_node_protocol_upgrade_voting_start` metric (#7877)
mina86 Oct 19, 2022
739629f
fix: remove second memory in smallest_rs_contract (#7874)
jakmeier Oct 19, 2022
c46b2ce
core: represent no voting schedule as timestamp in the past (#7880)
mina86 Oct 19, 2022
55346db
[Debug UI] Config to enable iterative local UI development (#7868)
robin-near Oct 20, 2022
6069308
[Debug UI] Show github link for version on debug page (#7869)
robin-near Oct 20, 2022
1b23fdd
store: pass StoreUpdate as argument to ShardTries::apply_all (#7870)
mina86 Oct 20, 2022
33e9966
Add option to verify proofs to neard (#7840)
mm-near Oct 20, 2022
def27de
refactor: remove `ContractCallError` (#7881)
jakmeier Oct 20, 2022
e50053f
o11y: introduce pretty::AbbrBytes formatter (#7886)
mina86 Oct 20, 2022
c267b03
docs: document documentation process (#7891)
matklad Oct 20, 2022
6399e68
move the check for is_height_processed forward (#7855)
mzhangmzz Oct 20, 2022
293d5b7
Added peer store information to network page (#7761)
mm-near Oct 20, 2022
c67162f
Do not use flat storage for storage_write (#7885)
mzhangmzz Oct 20, 2022
0c51a79
feat: limit trie cache by memory consumption (#7749)
jakmeier Oct 21, 2022
244812f
feat: add a transaction mirror binary (#7183)
marcelo-gonzalez Oct 21, 2022
a8b59d6
refactor: simplify error handling in main (#7897)
matklad Oct 21, 2022
d74d1de
doc: fix typos (#7904)
nujabes403 Oct 23, 2022
c08d9ff
crypto: Remove unused randomness module (#7907)
mina86 Oct 24, 2022
8b81c88
doc: update logo (#7905)
al002 Oct 24, 2022
fbb7668
[Debug UI] Fixed bug in network html when syncing (#7906)
mm-near Oct 24, 2022
163e529
removed messages of unimplemented EpochSync (#7911)
pompon0 Oct 24, 2022
afdf1f2
Prefer implementing `Display` to `From<T>` for `String` (#7914)
mina86 Oct 24, 2022
301c6a2
replaced Client struct with async_trait (#7913)
pompon0 Oct 24, 2022
b5990e6
mirror: make it easier to see what happened in debug logs (#7900)
marcelo-gonzalez Oct 24, 2022
05ab161
chain: remove TxStatusError::InvalidTx variant (#7915)
mina86 Oct 24, 2022
c0b7ae7
core: add chain Error → TxStatusError conversion (#7912)
mina86 Oct 24, 2022
58d17b0
fix(sync): Prevent state sync from being terminally verbose (#7864)
nikurt Oct 25, 2022
48bc4e8
doc: gas cost parameter chapter (#7918)
jakmeier Oct 25, 2022
9ef41b9
Changelog: include o11y changes (#7889)
nikurt Oct 25, 2022
4da9b5e
store: introduce cold storage (#7871)
mina86 Oct 25, 2022
6b9fc53
moved Network(View)Client(Messages/Responses) to near_client (#7908)
pompon0 Oct 25, 2022
f646de5
doc: Minor grammar fixes (#7922)
akhi3030 Oct 25, 2022
137b368
core: remove unused to_base58 function (#7920)
mina86 Oct 25, 2022
93e8c3e
chain: remove unnecessary `mut` from self reference (#7924)
mina86 Oct 25, 2022
1d99cf6
store: Update cold storage with one column (Block) #7744 (#7745)
posvyatokum Oct 25, 2022
9776fbd
[refactor] Refactor client and client actor to move the code for bloc…
mzhangmzz Oct 25, 2022
e96db55
Fix proposals shuffling implementation (#7921)
robin-near Oct 26, 2022
0d08a82
[Debug UI] Improve last-blocks debug page (#7902)
robin-near Oct 26, 2022
e4ea5a0
doc: fix gas section links and other small fixes (#7931)
jakmeier Oct 26, 2022
1533b3e
moved PeerStore from PeerManagerActor to NetworkState. (#7890)
pompon0 Oct 26, 2022
ab78201
doc: parameter overview (#7934)
jakmeier Oct 26, 2022
b2bcfe7
o11y: introduce pretty::Slice for formatting slices of arbitrary type…
mina86 Oct 26, 2022
3f6e349
split Network(View)ClientMessage enum into separate actix messages. (…
pompon0 Oct 26, 2022
d359e5b
store: adding State to cold columns (#7926)
posvyatokum Oct 26, 2022
17fbb14
Change debug page to display error messages in block processing (#7930)
mzhangmzz Oct 26, 2022
0c6a67d
store: adding StateChanges to cold columns (#7937)
posvyatokum Oct 27, 2022
a675096
Changing peer selection process & show connection errors in debug pag…
mm-near Oct 27, 2022
ed6b0b8
Split peer_manager tests into multiple files. (#7941)
pompon0 Oct 27, 2022
39be2cd
Removed the delay before the initial SyncRoutingTable. (#7940)
pompon0 Oct 27, 2022
4c9fae7
Added test for genesis hash (#7909)
mm-near Oct 27, 2022
5253f7f
feat: add a neard amend-genesis command (#7939)
marcelo-gonzalez Oct 27, 2022
c9f19ff
store: adding transactions & receipts columns to cold storage (#7943)
posvyatokum Oct 27, 2022
96ca45b
chain: flatten match pattern to reduce indentation depth (#7945)
mina86 Oct 27, 2022
e428f4e
store: adding final cold columns (#7950)
posvyatokum Oct 27, 2022
81686c8
docs: move docs about receipts from confluence (#7947)
matklad Oct 27, 2022
21af417
chore: introduce `--profile prod` (#7923)
matklad Oct 27, 2022
5e13791
crypto: move base58 formatting into single struct reducing duplicatio…
mina86 Oct 28, 2022
2dd4c90
logic: improve test coverage and error messages of ed25519_verify (#7…
blasrodri Oct 28, 2022
5f0f571
docs: review docs/practices/docs.md (#7957)
nagisa Oct 28, 2022
0863a00
docs: proof-read fast-builds nearcore book page (#7956)
nagisa Oct 28, 2022
57e9c41
doc: how to add a new parameter (#7952)
jakmeier Oct 28, 2022
e9e9373
feat: trie cache configuration (#7578)
jakmeier Oct 28, 2022
4085ad6
refactor: cleanup ed25519_verify (#7955)
matklad Oct 31, 2022
1aeaaee
Speedy-sync - experimental tool for faster syncing (#6914)
mm-near Oct 31, 2022
a4c01bd
fixed compilation error in store_bench (#7963)
mm-near Oct 31, 2022
ce8fd02
[DEBUG] move chain processing status to a separate API endpoint (#7962)
mm-near Oct 31, 2022
f76a428
Download records.json when initializing configs (#7946)
nikurt Oct 31, 2022
4b66082
fix(amend-genesis): remove unwanted changes to the output genesis (#7…
marcelo-gonzalez Oct 31, 2022
cbcb079
feat: add a ping tool (#7541)
marcelo-gonzalez Oct 31, 2022
da0fe32
fix(mocknet): Fix config.json (#7968)
nikurt Oct 31, 2022
9c4afdb
[chunks] Move maintenance of ready-to-include chunks out of ShardsMan…
robin-near Oct 31, 2022
f37e6ea
feat(o11y): Tracing of work caused by network messages received by Pe…
nikurt Nov 1, 2022
16fcaf8
doc: move serialization docs over from confluence (#7951)
matklad Nov 2, 2022
133b604
store: read BlockHeader from hot db when accessing through ColdDB (#7…
mina86 Nov 2, 2022
389ec89
doc: estimator quick start and high-level overview (#7981)
jakmeier Nov 2, 2022
b8daad4
feat: estimate `ed25519` base and bytes separately (#7980)
jakmeier Nov 2, 2022
6c8adfb
moved is_inbound_allowed to NetworkState (#7975)
pompon0 Nov 2, 2022
6e3f72d
moved rayon utils to concurrency module (#7974)
pompon0 Nov 2, 2022
869d6d7
docs: move proof docs over from confluence (#7959)
matklad Nov 2, 2022
b44dd15
refactor: simplify get_epoch_sync_data_hash (#7969)
matklad Nov 2, 2022
2a08fc6
refactor: move parts API to the epoch manager (#7967)
matklad Nov 2, 2022
031fe4b
store: disable refcount merge operator when opening cold RocksDB (#7954)
mina86 Nov 3, 2022
6726993
feat: design for flat storage creation (#7979)
Longarithm Nov 4, 2022
942358e
fix: use new database version for flat state (#7984)
jakmeier Nov 4, 2022
2b1b229
docs: clarify that `Db::Receipts` doesn't store _all_ receipts (#7982)
matklad Nov 4, 2022
8ba9b78
moved fixing local edges to a background task. (#7977)
pompon0 Nov 4, 2022
ae03871
chore: upgrade rust-version to 1.65.0 (#7993)
jakmeier Nov 4, 2022
b6127ba
debug: add assertions to flat state get_ref (#7985)
jakmeier Nov 4, 2022
82a0451
refactor: simplify `split_method_names` in vm Logic (#7998)
matklad Nov 4, 2022
198ed0b
feat: trie storage for parallel reads (#7987)
Longarithm Nov 4, 2022
25b6aa5
Add support for dynamic config and use it for expected shutdown (#7872)
yanganto Nov 5, 2022
35eaacd
Fixed broadcasting of AnnounceAccounts (#7973)
pompon0 Nov 5, 2022
e9d3ac1
docs: more in-depth overview of gas parameters (#7999)
jakmeier Nov 7, 2022
56f7226
crypto: remove unused impl (#8000)
mina86 Nov 7, 2022
aee5d43
chore: no rust-version for unpublishable contracts (#7997)
jakmeier Nov 7, 2022
8f6ee99
refactor: move miscelaneous epoch APIs to epoch manager adapter (#7994)
matklad Nov 7, 2022
1650085
Move sync into check_triggers (#7988)
mm-near Nov 7, 2022
36ec5dc
fix: mark slow tests as such (#7970)
matklad Nov 7, 2022
6329fd1
feat: Track requested state parts (#8008)
askoa Nov 8, 2022
4870039
[DEBUG] Added api to export current graph layout (#7965)
mm-near Nov 8, 2022
219c164
feat: test for flat storage background creation (#8003)
Longarithm Nov 8, 2022
4da67ee
replaced ResponseUpdateNonce with SyncRoutingTable (#8009)
pompon0 Nov 8, 2022
84014e7
refactor: simplify synchronization for next hops table (#8005)
matklad Nov 8, 2022
baf61ae
crypto: Rust has &[T] → [T; N] conversion for arbitrary N; use it (#8…
mina86 Nov 8, 2022
916725f
crypto: remove unnecessary use of arrayref dependency (#8012)
mina86 Nov 8, 2022
27e96ba
docs: estimator metrics (#8010)
jakmeier Nov 8, 2022
6a79fb8
nit(amend-genesis): print out path names in errors (#8016)
marcelo-gonzalez Nov 8, 2022
926ffcd
Adversenet operational scripts (#7972)
robin-near Nov 8, 2022
aca6ec7
Add `maintenance_window` RPC (#7887)
yanganto Nov 9, 2022
bc08592
Added documentation about cross shard transactions (#8014)
mm-near Nov 9, 2022
18ab454
Refactored routing table edges verification. (#8002)
pompon0 Nov 9, 2022
cc9a996
fix: block hash in trie for storage usage test (#8017)
Longarithm Nov 9, 2022
b871a72
feat: add a node ping tool
marcelo-gonzalez Jul 30, 2022
5cac2df
dump ping latencies to a CSV
marcelo-gonzalez Aug 3, 2022
751b368
keep track of timeouts
marcelo-gonzalez Aug 4, 2022
229ae54
Merge
Aug 29, 2022
7ac1c66
Compilation fix
Aug 29, 2022
3a38ec6
Export prometheus metrics from the ping tool.
Nov 9, 2022
70c3f20
Merge branch 'master' into nikurt-ping-metrics
nikurt Nov 9, 2022
608c068
Rework.
Nov 10, 2022
e23757d
No push
Nov 10, 2022
f84c568
Export prometheus metrics.
Nov 10, 2022
2831a87
Merge branch 'master' into nikurt-ping-metrics
nikurt Nov 10, 2022
7db8409
Add `chain_id`
Nov 11, 2022
c095e23
Merge branch 'master' into nikurt-ping-metrics
nikurt Nov 11, 2022
bbbfc0a
Reuse prometheus_handler
Nov 14, 2022
3091532
Merge branch 'master' into nikurt-ping-metrics
nikurt Nov 14, 2022
ade07eb
Merge master into nikurt-ping-metrics
near-bulldozer[bot] Nov 15, 2022
8f30faf
Merge refs/heads/master into nikurt-ping-metrics
near-bulldozer[bot] Nov 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tools/ping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ rust-version.workspace = true
edition = "2021"

[dependencies]
actix-web.workspace = true
anyhow.workspace = true
chrono.workspace = true
clap.workspace = true
once_cell.workspace = true
prometheus.workspace = true
tokio.workspace = true
tracing.workspace = true

Expand Down
4 changes: 4 additions & 0 deletions tools/ping/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub struct PingCommand {
/// number of seconds to wait for incoming data before timing out
#[clap(long)]
recv_timeout_seconds: Option<u32>,
/// Listen address for prometheus metrics.
#[clap(long, default_value = "0.0.0.0:9000")]
prometheus_addr: String,
}

fn display_stats(stats: &mut [(crate::PeerIdentifier, crate::PingStats)], peer_id: &PeerId) {
Expand Down Expand Up @@ -212,6 +215,7 @@ impl PingCommand {
filter,
csv,
&mut stats,
&self.prometheus_addr,
)
.await?;
display_stats(&mut stats, &peer.id);
Expand Down
57 changes: 46 additions & 11 deletions tools/ping/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use actix_web::{web, App, Error as HttpError, HttpResponse, HttpServer};
use anyhow::Context;
pub use cli::PingCommand;
use near_network::raw::{ConnectError, Connection, ReceivedMessage};
use near_network::time;
use near_network::types::HandshakeFailureReason;
use near_primitives::hash::CryptoHash;
use near_primitives::network::PeerId;
use near_primitives::types::{AccountId, BlockHeight, EpochId};
use near_primitives::version::ProtocolVersion;
use prometheus::{Encoder, TextEncoder};
use std::cmp;
use std::collections::hash_map::Entry;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
Expand All @@ -14,8 +17,18 @@ use std::pin::Pin;

pub mod cli;
mod csv;
mod metrics;

pub use cli::PingCommand;
async fn prometheus_handler() -> Result<HttpResponse, HttpError> {
nikurt marked this conversation as resolved.
Show resolved Hide resolved
let mut buffer = vec![];
let encoder = TextEncoder::new();
encoder.encode(&prometheus::gather(), &mut buffer).unwrap();

match String::from_utf8(buffer) {
Ok(text) => Ok(HttpResponse::Ok().body(text)),
Err(_) => Ok(HttpResponse::ServiceUnavailable().finish()),
}
}

// TODO: also log number of bytes/other messages (like Blocks) received?
#[derive(Debug, Default)]
Expand Down Expand Up @@ -122,15 +135,17 @@ struct AppInfo {
requests: BTreeMap<PingTarget, HashMap<Nonce, PingTimes>>,
timeouts: BTreeSet<PingTimeout>,
account_filter: Option<HashSet<AccountId>>,
chain_id: String,
}

impl AppInfo {
fn new(account_filter: Option<HashSet<AccountId>>) -> Self {
fn new(account_filter: Option<HashSet<AccountId>>, chain_id: &str) -> Self {
Self {
stats: HashMap::new(),
requests: BTreeMap::new(),
timeouts: BTreeSet::new(),
account_filter,
chain_id: chain_id.to_owned(),
}
}

Expand All @@ -143,10 +158,15 @@ impl AppInfo {
None
}

fn ping_sent(&mut self, peer_id: &PeerId, nonce: u64) {
fn ping_sent(&mut self, peer_id: &PeerId, nonce: u64, chain_id: &str) {
let timestamp = time::Instant::now();
let timeout = timestamp + PING_TIMEOUT;

let account_id = self.peer_id_to_account_id(&peer_id);
crate::metrics::PING_SENT
.with_label_values(&[&chain_id, &peer_str(peer_id, account_id)])
.inc();

match self.stats.entry(peer_id.clone()) {
Entry::Occupied(mut e) => {
let state = e.get_mut();
Expand Down Expand Up @@ -212,7 +232,7 @@ impl AppInfo {
assert!(self.timeouts.remove(&PingTimeout {
peer_id: peer_id.clone(),
nonce,
timeout: times.timeout
timeout: times.timeout,
}));

let l: std::time::Duration = latency.try_into().unwrap();
Expand Down Expand Up @@ -322,8 +342,12 @@ fn handle_message(
) -> anyhow::Result<()> {
match &msg {
ReceivedMessage::Pong { nonce, source } => {
let chain_id = app_info.chain_id.clone(); // Avoid an immutable borrow during a mutable borrow.
if let Some((latency, account_id)) = app_info.pong_received(source, *nonce, received_at)
{
crate::metrics::PONG_RECEIVED
.with_label_values(&[&chain_id, &peer_str(&source, account_id)])
.observe(latency.as_seconds_f64());
if let Some(csv) = latencies_csv {
csv.write(source, account_id, latency).context("Failed writing to CSV file")?;
}
Expand Down Expand Up @@ -380,8 +404,9 @@ async fn ping_via_node(
account_filter: Option<HashSet<AccountId>>,
mut latencies_csv: Option<crate::csv::LatenciesCsv>,
ping_stats: &mut Vec<(PeerIdentifier, PingStats)>,
prometheus_addr: &str,
) -> anyhow::Result<()> {
let mut app_info = AppInfo::new(account_filter);
let mut app_info = AppInfo::new(account_filter, chain_id);

app_info.add_peer(&peer_id, None);

Expand All @@ -392,10 +417,7 @@ async fn ping_via_node(
chain_id,
genesis_hash,
head_height,
time::Duration::seconds(recv_timeout_seconds.into()),
)
.await
{
time::Duration::seconds(recv_timeout_seconds.into())).await {
Ok(p) => p,
Err(ConnectError::HandshakeFailure(reason)) => {
match reason {
Expand Down Expand Up @@ -425,6 +447,17 @@ async fn ping_via_node(
let next_timeout = tokio::time::sleep(std::time::Duration::ZERO);
tokio::pin!(next_timeout);

let server = HttpServer::new(move || {
App::new().service(web::resource("/metrics").route(web::get().to(prometheus_handler)))
})
.bind(prometheus_addr)
.unwrap()
.workers(1)
.shutdown_timeout(3)
.disable_signals()
.run();
tokio::spawn(server);

loop {
let target = app_info.pick_next_target();
let pending_timeout = prepare_timeout(next_timeout.as_mut(), &app_info);
Expand All @@ -436,7 +469,7 @@ async fn ping_via_node(
if result.is_err() {
break;
}
app_info.ping_sent(&target, nonce);
app_info.ping_sent(&target, nonce, &chain_id);
nonce += 1;
next_ping.as_mut().reset(tokio::time::Instant::now() + std::time::Duration::from_millis(ping_frequency_millis));
}
Expand All @@ -461,10 +494,12 @@ async fn ping_via_node(
_ = &mut next_timeout, if pending_timeout.is_some() => {
let t = pending_timeout.unwrap();
app_info.pop_timeout(&t);
let account_id = app_info.peer_id_to_account_id(&t.peer_id);
crate::metrics::PONG_TIMEOUTS.with_label_values(&[&chain_id, &peer_str(&t.peer_id, account_id)]).inc();
if let Some(csv) = latencies_csv.as_mut() {
result = csv.write_timeout(
&t.peer_id,
app_info.peer_id_to_account_id(&t.peer_id)
account_id,
)
.context("Failed writing to CSV file");
if result.is_err() {
Expand Down
33 changes: 33 additions & 0 deletions tools/ping/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use near_o11y::metrics::{
exponential_buckets, try_create_histogram_vec, try_create_int_counter_vec, HistogramVec,
IntCounterVec,
};
use once_cell::sync::Lazy;

pub(crate) static PONG_RECEIVED: Lazy<HistogramVec> = Lazy::new(|| {
nikurt marked this conversation as resolved.
Show resolved Hide resolved
try_create_histogram_vec(
"ping_pong_received",
"Round-trip time of ping-pong",
&["chain_id", "account_id"],
Some(exponential_buckets(0.00001, 1.6, 40).unwrap()),
)
.unwrap()
});

pub(crate) static PONG_TIMEOUTS: Lazy<IntCounterVec> = Lazy::new(|| {
try_create_int_counter_vec(
"ping_pong_timeout",
"Number of pongs that were not received",
&["chain_id", "account_id"],
)
.unwrap()
});

pub(crate) static PING_SENT: Lazy<IntCounterVec> = Lazy::new(|| {
try_create_int_counter_vec(
"ping_ping_sent",
"Number of pings sent",
&["chain_id", "account_id"],
)
.unwrap()
});