4 Commits

Author SHA1 Message Date
f64be062c4 Prometheus: Improve response parser performance (#101517)
* introduce tests

* improve allocation by %61

* ~%27 improvement

goos: darwin
goarch: arm64
pkg: github.com/grafana/grafana/pkg/promlib/converter
cpu: Apple M1 Pro
                                                            │  pmem.0.txt  │             pmem.2.txt             │
                                                            │    sec/op    │   sec/op     vs base               │
ReadPrometheusStyleResult_FromFile/prom-query-range.json-10   117.72µ ± 6%   82.90µ ± 4%  -29.57% (p=0.002 n=6)

                                                            │  pmem.0.txt   │             pmem.2.txt              │
                                                            │     B/op      │     B/op      vs base               │
ReadPrometheusStyleResult_FromFile/prom-query-range.json-10   104.34Ki ± 0%   76.09Ki ± 0%  -27.08% (p=0.002 n=6)

                                                            │ pmem.0.txt  │            pmem.2.txt             │
                                                            │  allocs/op  │ allocs/op   vs base               │
ReadPrometheusStyleResult_FromFile/prom-query-range.json-10   2463.0 ± 0%   899.0 ± 0%  -63.50% (p=0.002 n=6)

* add more tests

* remove comment lines

* read string as slice to prevent type conversion

* golang lint

* revert appendValueFromString improvement

* fix merging issues
2025-03-12 13:16:19 +01:00
e3e51f6e3b Prometheus datasource: Show info annotations in the UI (#97978)
* Show info annotations from Prometheus datasources in the UI

* Add test data for backend
2025-01-03 20:09:19 +01:00
297ccfc52c Prometheus: Show notice when there is no data (#93936)
Show notice when there is no data
2024-11-05 08:25:28 +01:00
3fb6319d1b Prometheus: Introduce prometheus backend library (#83952)
* Move files to prometheus-library

* refactor core prometheus to use prometheus-library

* modify client transport options

* mock

* have a type

* import aliases

* rename

* call the right method

* remove unrelated test from the library

* update codeowners

* go work sync

* update go.work.sum

* make swagger-clean && make openapi3-gen

* add promlib to makefile

* remove clilogger

* Export the function

* update unit test

* add prometheus_test.go

* fix mock type

* use mapUtil from grafana-plugin-sdk-go
2024-03-11 17:22:33 +01:00