Stats.h
Go to the documentation of this file.
1 /****
2  * Stats.h - Maintain useful statistics for actions performed by a Hue Bridge
3  *
4  * Copyright 2019 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the HueEmulator Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #include <stdint.h>
23 #include <ArduinoJson6.h>
24 
25 namespace Hue
26 {
27 struct Stats {
28  struct {
29  uint16_t count;
30  uint16_t root;
31  uint16_t ignored;
32  uint16_t getAllDeviceInfo;
33  uint16_t getDeviceInfo;
34  uint16_t setDeviceInfo;
36  struct {
37  uint16_t count;
38  size_t size;
40  struct {
41  uint16_t count;
44  uint16_t unauthorizedUser;
45  } error;
46 
47  void serialize(JsonObject json) const;
48 };
49 
50 } // namespace Hue
Json json
Definition: Bridge.h:30
Definition: Stats.h:27
uint16_t unauthorizedUser
Definition: Stats.h:44
uint16_t count
Total number of HTTP requests.
Definition: Stats.h:29
uint16_t getAllDeviceInfo
Definition: Stats.h:32
struct Hue::Stats::@73 response
struct Hue::Stats::@74 error
uint16_t setDeviceInfo
Definition: Stats.h:34
size_t size
Total size of response data.
Definition: Stats.h:38
uint16_t resourceNotAvailable
Definition: Stats.h:42
uint16_t getDeviceInfo
Definition: Stats.h:33
uint16_t ignored
Requests not starting with /api.
Definition: Stats.h:31
uint16_t methodNotAvailable
Definition: Stats.h:43
void serialize(JsonObject json) const
uint16_t root
eRequests handled by root UPnP device
Definition: Stats.h:30
struct Hue::Stats::@72 request