https://github.com/lincc-frameworks/metric-emitter
https://github.com/lincc-frameworks/metric-emitter
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lincc-frameworks/metric-emitter
- Owner: lincc-frameworks
- License: mit
- Created: 2023-06-20T23:26:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T22:34:43.000Z (over 2 years ago)
- Last Synced: 2023-11-03T23:26:56.375Z (over 2 years ago)
- Language: Python
- Size: 28.3 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lf-metric-emitter


This tool encapsulates the code needed to emit metrics to the Sasquatch InfluxDB
stack. https://sasquatch.lsst.io/index.html
To utilize this tool, two environment variables must be set:
1) `BENCHMARK_ENV` should be set to something consistent, for instance, `github-ci`, `epic`, `local-desktop-1`, etc.
2) `KAFKA_API_URL` should be set to the full url. See the Sasquatch documentation for the specific URL.
You'll also need to manually create a Kafka topic to receive the metrics that are
emitted. Again, see the Sasquatch documentation for instructions.
With the Kafka topic created, and the environmental variables, metrics can be emitted like so:
```
# result from a timing bench mark
my_result = 42.0
emitter = Emitter(namespace='lsst.lf',
name='ssppIncubator.bench',
module='PPApplyColourOffset',
benchmark_type:'runtime',
benchmark_unit:'s')
emitter.set_value(my_result)
emitter.emit()
```
[](https://lincc-ppt.readthedocs.io/en/latest/)
This project was automatically generated using the LINCC-Frameworks [python-project-template](https://github.com/lincc-frameworks/python-project-template).
For more information about the project template see the [documentation](https://lincc-ppt.readthedocs.io/en/latest/).