Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trentm/tmp-cmeta
tmp play repo
https://github.com/trentm/tmp-cmeta
Last synced: about 1 month ago
JSON representation
tmp play repo
- Host: GitHub
- URL: https://github.com/trentm/tmp-cmeta
- Owner: trentm
- Created: 2021-01-08T00:55:48.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-08T01:02:47.000Z (almost 4 years ago)
- Last Synced: 2024-10-19T19:54:59.648Z (2 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```
% node userapp.js
AGENT: start gathering <-- start gathering on agent.start()
AGENT: agent started
USERAPP: sending span <-- app sends span before gathering is done
AGENT: sending a span
USERAPP: listening at http://localhost:3000
AGENT: done gathering <-- when gathered ...
CLIENT: got encoded metadata <-- client gets it and uses it:
{"thisIsMyCloud":"there are many like it"}
{"name":"setup","time":"2021-01-08T00:59:04.664Z"}
AGENT: emitted metadata event<-- curl localhost:3000
AGENT: sending a span
CLIENT: got encoded metadata <-- gets cached metadata
{"thisIsMyCloud":"there are many like it"}
{"name":"handled request","time":"2021-01-08T00:59:15.702Z"}
^C
```Or with a number of `curl localhost:3000` requests before the metadata is
gathered they buffer up on that `this._conf.metadataGatherer.once('metadata',`.```
% node userapp.js
AGENT: start gathering
AGENT: agent started
USERAPP: sending span
AGENT: sending a span
USERAPP: listening at http://localhost:3000
AGENT: sending a span
AGENT: sending a span
AGENT: sending a span
AGENT: done gathering
CLIENT: got encoded metadata
{"thisIsMyCloud":"there are many like it"}
{"name":"setup","time":"2021-01-08T01:00:16.114Z"}
CLIENT: got encoded metadata
{"thisIsMyCloud":"there are many like it"}
{"name":"handled request","time":"2021-01-08T01:00:18.183Z"}
CLIENT: got encoded metadata
{"thisIsMyCloud":"there are many like it"}
{"name":"handled request","time":"2021-01-08T01:00:18.911Z"}
CLIENT: got encoded metadata
{"thisIsMyCloud":"there are many like it"}
{"name":"handled request","time":"2021-01-08T01:00:19.579Z"}
AGENT: emitted metadata event
```If we are worried about that buffering too large, then we could consider a
limited queue, but I'm not sure that's a concern for startup time.