forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingester: Defer converting from LabelPairs to Metric until flush (gra…
…fana#997) * Defer converting from LabelPairs to Metric until needed Since we average hundreds of samples to a chunk, it saves a lot of work to leave label name/value sets as the slice they come in as, rather than converting to the map type that Prometheus uses. They are converted on flush, to avoid changing the chunk store. * Store labelPairs in series sorted, for faster lookup * Extract BenchmarkMetric as re-usable fixture for tests * Add benchmark for Ingester Push() * Copy name/value bytes, to avoid keeping the gRPC buffer alive
- Loading branch information
Showing
2 changed files
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package chunk | ||
|
||
import "github.com/prometheus/common/model" | ||
|
||
// BenchmarkMetric is a real example from Kubernetes' embedded cAdvisor metrics, lightly obfuscated | ||
var BenchmarkMetric = model.Metric{ | ||
model.MetricNameLabel: "container_cpu_usage_seconds_total", | ||
"beta_kubernetes_io_arch": "amd64", | ||
"beta_kubernetes_io_instance_type": "c3.somesize", | ||
"beta_kubernetes_io_os": "linux", | ||
"container_name": "some-name", | ||
"cpu": "cpu01", | ||
"failure_domain_beta_kubernetes_io_region": "somewhere-1", | ||
"failure_domain_beta_kubernetes_io_zone": "somewhere-1b", | ||
"id": "/kubepods/burstable/pod6e91c467-e4c5-11e7-ace3-0a97ed59c75e/a3c8498918bd6866349fed5a6f8c643b77c91836427fb6327913276ebc6bde28", | ||
"image": "registry/organisation/name@sha256:dca3d877a80008b45d71d7edc4fd2e44c0c8c8e7102ba5cbabec63a374d1d506", | ||
"instance": "ip-111-11-1-11.ec2.internal", | ||
"job": "kubernetes-cadvisor", | ||
"kubernetes_io_hostname": "ip-111-11-1-11", | ||
"monitor": "prod", | ||
"name": "k8s_some-name_some-other-name-5j8s8_kube-system_6e91c467-e4c5-11e7-ace3-0a97ed59c75e_0", | ||
"namespace": "kube-system", | ||
"pod_name": "some-other-name-5j8s8", | ||
} |