type_stats - BenjaminFourmaux/ServiceDown-api GitHub Wiki

Type : Stats

Represent a stats 1H or 24H

Fields

Name Description Type
id Id of node service_countries number
service Id of service number
country Id of country number
intervals List of number of reports in slice list<Number>
totalReport Total of report in this range number

Variants

  • Stats 1H : slice of 5 minutes * 12
  • Stats 24H : slice of 1 hour * 24

Exemple

An example of stats 1H with service Orange and country France

{
	"id": 234,
	"service": 146,
	"country": 74,
	"intervals" : [
		2,
		4,
		6,
		8,
		10,
		12,
		14,
		16,
		18,
		20,
		22,
		24,
	],
	"totalReport": 156
}

First index of intervals array correspondent at the most older stats report and last index correspondent at the most younger stats report

	# For stats 1H
	# now() - 1 Hour
	intervals[0]

	# now() - 5 minutes
	intervals[-1] or intervals[11]

	# For stats 24H
	# now() - 24 Hours
	intervals[0]

	# now() - 1 Hour
	intervals[-1] or intervals[23]