-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from CESNET/appfs-telemetry
Introduce Appfs telemetry
- Loading branch information
Showing
29 changed files
with
645 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* \file | ||
* \brief Definition of the ParserStats structure for storing parser statistics | ||
* \author Pavel Siska <siska@cesnet.cz> | ||
* \date 2024 | ||
*/ | ||
/* | ||
* Copyright (C) 2024 CESNET | ||
* | ||
* LICENSE TERMS | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* 3. Neither the name of the Company nor the names of its contributors | ||
* may be used to endorse or promote products derived from this | ||
* software without specific prior written permission. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
namespace ipxp { | ||
|
||
/** | ||
* \brief Structure for storing parser statistics. | ||
*/ | ||
struct ParserStats { | ||
uint64_t mpls_packets; | ||
uint64_t vlan_packets; | ||
uint64_t pppoe_packets; | ||
uint64_t trill_packets; | ||
|
||
uint64_t ipv4_packets; | ||
uint64_t ipv6_packets; | ||
|
||
uint64_t tcp_packets; | ||
uint64_t udp_packets; | ||
|
||
uint64_t seen_packets; | ||
uint64_t unknown_packets; | ||
}; | ||
|
||
} // namespace ipxp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* \file | ||
* \brief Contains the TelemetryUtils class for managing telemetry data. | ||
* \author Pavel Siska <siska@cesnet.cz> | ||
* \date 2024 | ||
*/ | ||
/* | ||
* Copyright (C) 2024 CESNET | ||
* | ||
* LICENSE TERMS | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* 3. Neither the name of the Company nor the names of its contributors | ||
* may be used to endorse or promote products derived from this | ||
* software without specific prior written permission. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string_view> | ||
#include <memory> | ||
#include <telemetry.hpp> | ||
|
||
namespace ipxp { | ||
|
||
class TelemetryUtils { | ||
public: | ||
|
||
/** | ||
* @brief Register a File in the telemetry holder | ||
* | ||
* If the file is already registered, it will not be registered again. | ||
* | ||
* @param directory Directory to register the file in | ||
* @param filename Name of the file | ||
* @param ops File operations | ||
*/ | ||
void register_file( | ||
std::shared_ptr<telemetry::Directory> directory, | ||
const std::string_view& filename, | ||
telemetry::FileOps ops) | ||
{ | ||
if (directory->getEntry(filename)) { | ||
return; | ||
} | ||
|
||
auto file = directory->addFile(filename, ops); | ||
m_holder.add(file); | ||
} | ||
|
||
protected: | ||
telemetry::Holder m_holder; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.