Pregunta

According to https://newrelic.com/docs/plugin-dev/metric-data-for-the-plugin-api plugins should also report the sum of squares for the specified period. Taking a look at the JSON example, I'd say this is more a square of the total value. E.g.:

{
  "name": "Primary MySQL Database",
  "guid": "com.your_company_name.plugin_name",
  "duration" : 60,
  "metrics" : {
    "Component/ProductionDatabase[Queries/Second]": 100,
    "Component/AnalyticsDatabase[Queries/Second]": {
      "min" : 2,
      "max" : 10,
      "total": 12,
      "count" : 2,
      "sum_of_squares" : 144
    }
  }
}

Obviously there were two values, 2 and 10. According to the sample the sum_of_squares is (10+2)^2=144 which I would define as "square of total". For me however, the term "sum of squares" would be 2^2+10^2=104.

So when taking about multi-value metrics - which one is the correct number?

¿Fue útil?

Solución

You're absolutely right that the example values as documented are incorrect. I'll notify the relevant parties to update the documentation.

In the common case where only a single metric value is being reported, the count will be (1), in which case squaring the "total" value yields the correct result.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top