SearchSECODatabaseAPI
Statistics Class Reference

Stores the Prometheus statistics variables. More...

#include <Statistics.h>

Public Member Functions

virtual void Initialize ()
 Initializes all statistics objects.
 
void addRecentProject (std::string url)
 Add a recently added project. More...
 
void addRecentVulnerability (std::string vulnCode)
 Add a recently added vulnerability. More...
 
void synchronize (std::string file)
 Regularly synchronizes the statistics to the passed file. More...
 
void writeToFile (std::string file)
 Write the value of the statistics to the given file. More...
 
void readFromFile (std::string file)
 Reads the values of the statistics from the passed file. More...
 

Public Attributes

prometheus::Family< prometheus::Counter > * requestCounter
 
prometheus::Family< prometheus::Counter > * methodCounter
 
prometheus::Family< prometheus::Counter > * languageCounter
 
prometheus::Family< prometheus::Counter > * jobCounter
 
prometheus::Family< prometheus::Gauge > * latestRequest
 
prometheus::Family< prometheus::Counter > * vulnCounter
 
prometheus::Family< prometheus::Gauge > * recentProjects
 
prometheus::Family< prometheus::Gauge > * recentVulns
 
std::string myIP
 
bool newRequest
 

Protected Attributes

prometheus::Exposer * exposer
 
std::shared_ptr< prometheus::Registry > registry
 
std::queue< prometheus::Gauge * > recentProjectsQueue
 
std::queue< prometheus::Gauge * > recentVulnsQueue
 

Detailed Description

Stores the Prometheus statistics variables.

Member Function Documentation

◆ addRecentProject()

void Statistics::addRecentProject ( std::string  url)

Add a recently added project.

Parameters
urlThe url of the project added.

◆ addRecentVulnerability()

void Statistics::addRecentVulnerability ( std::string  vulnCode)

Add a recently added vulnerability.

Parameters
vulnCodeThe vulnerability code of the vulnerability added.

◆ readFromFile()

void Statistics::readFromFile ( std::string  file)

Reads the values of the statistics from the passed file.

Parameters
fileThe file to read the statistics from.

◆ synchronize()

void Statistics::synchronize ( std::string  file)

Regularly synchronizes the statistics to the passed file.

Parameters
fileThe file to write the statistic to.

◆ writeToFile()

void Statistics::writeToFile ( std::string  file)

Write the value of the statistics to the given file.

Parameters
fileThe file to write the statistics to.

The documentation for this class was generated from the following files: