Change CCMetric's internal data structure (#22)

* package ccmetric rewrite

* Create deep copy in New() to avoid access conflicts

* Renamed TagMap() -> Tags(), MetaMap() -> Meta

Co-authored-by: Holger Obermaier <40787752+ho-ob@users.noreply.github.com>
This commit is contained in:
Thomas Gruber
2022-02-01 14:54:34 +01:00
committed by GitHub
parent 862630a218
commit 6ff6cb7219
4 changed files with 92 additions and 158 deletions

View File

@@ -141,11 +141,11 @@ func (r *metricRouter) EvalCondition(cond string, point lp.CCMetric) (bool, erro
// Add metric name, tags, meta data, fields and timestamp to the parameter list
params := make(map[string]interface{})
params["name"] = point.Name()
for _, t := range point.TagList() {
params[t.Key] = t.Value
for key, value := range point.Tags() {
params[key] = value
}
for _, m := range point.MetaList() {
params[m.Key] = m.Value
for key, value := range point.Meta() {
params[key] = value
}
for _, f := range point.FieldList() {
params[f.Key] = f.Value