mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
Модуль Benchmark
This commit is contained in:
@@ -7,3 +7,4 @@ extern std::list<IoTItem*> IoTItems; // вектор ссылок базово
|
||||
extern void configure(String path);
|
||||
void clearConfigure();
|
||||
extern IoTItem* myIoTItem;
|
||||
extern IoTBench* myIoTBernch;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "utils/StringUtils.h"
|
||||
#include "PeriodicTasks.h"
|
||||
#include "classes/IoTGpio.h"
|
||||
#include "classes/IoTBench.h"
|
||||
|
||||
/*********************************************************************************************************************
|
||||
*****************************************глобальные объекты классов***************************************************
|
||||
@@ -58,6 +59,8 @@ extern IoTGpio IoTgpio;
|
||||
extern IoTItem* rtcItem;
|
||||
//extern IoTItem* camItem;
|
||||
extern IoTItem* tlgrmItem;
|
||||
extern IoTBench* benchLoadItem;
|
||||
extern IoTBench* benchTaskItem;
|
||||
|
||||
extern TickerScheduler ts;
|
||||
extern WiFiClient espClient;
|
||||
|
||||
30
include/classes/IoTBench.h
Normal file
30
include/classes/IoTBench.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
#include <map>
|
||||
|
||||
struct ItemBench
|
||||
{
|
||||
uint32_t sumloopTime = 0;
|
||||
uint32_t loopTime = 0;
|
||||
uint32_t loopTimeMax_p = 0;
|
||||
uint32_t loopTimeMax_glob = 0;
|
||||
uint32_t count = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IoTBench : public IoTItem
|
||||
{
|
||||
public:
|
||||
IoTBench(const String ¶meters);
|
||||
~IoTBench();
|
||||
|
||||
virtual void preLoadFunction();
|
||||
virtual void postLoadFunction();
|
||||
virtual void preTaskFunction(const String &id);
|
||||
virtual void postTaskFunction(const String &id);
|
||||
protected:
|
||||
std::map<String, ItemBench *> banchItems;
|
||||
};
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
#include "classes/IoTGpio.h"
|
||||
//#include "classes/IoTBench.h"
|
||||
|
||||
class IoTBench;
|
||||
|
||||
struct IoTValue {
|
||||
float valD = 0;
|
||||
@@ -53,6 +56,9 @@ class IoTItem {
|
||||
virtual IoTItem* getRtcDriver();
|
||||
//virtual IoTItem* getCAMDriver();
|
||||
virtual IoTItem* getTlgrmDriver();
|
||||
//virtual IoTBench* getBenchmark();
|
||||
virtual IoTBench*getBenchmarkTask();
|
||||
virtual IoTBench*getBenchmarkLoad();
|
||||
virtual unsigned long getRtcUnixTime();
|
||||
|
||||
// делаем доступным модулям отправку сообщений в телеграм
|
||||
|
||||
Reference in New Issue
Block a user