Skip to content

Commit 78b4d8a

Browse files
author
Damir Zainullin
committed
++ input plugin base class
1 parent 444ba0a commit 78b4d8a

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

include/ipfixprobe/parser-stats.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525

2626
#pragma once
2727

28+
#include "../../src/plugins/input/parser/topPorts.hpp"
29+
30+
#include <array>
2831
#include <cstdint>
2932
#include <string>
30-
#include <array>
33+
3134
#include <ipfixprobe/packet.hpp>
3235
#include <telemetry.hpp>
3336

34-
#include "../../src/plugins/input/parser/topPorts.hpp"
35-
3637
namespace ipxp {
3738

3839
static constexpr std::size_t MAX_VLAN_ID = 4096;

src/core/inputPlugin.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ static telemetry::Content get_parser_stats_content(const ParserStats& parserStat
4040
const std::vector<TopPorts::PortStats>& ports = parserStats.top_ports.get_top_ports();
4141
if (ports.empty()) {
4242
dict["top_10_ports"] = "";
43-
} else {
43+
} else {
4444
std::string top_ports = ports[0].to_string();
45-
dict["top_10_ports"] = std::accumulate(ports.begin() + 1, ports.end(), top_ports,
46-
[](std::string acc, const TopPorts::PortStats& port_frequency) {
47-
return acc + ", " + port_frequency.to_string();
48-
});
49-
}
45+
dict["top_10_ports"] = std::accumulate(
46+
ports.begin() + 1,
47+
ports.end(),
48+
top_ports,
49+
[](std::string acc, const TopPorts::PortStats& port_frequency) {
50+
return acc + ", " + port_frequency.to_string();
51+
});
52+
}
5053
return dict;
5154
}
5255

0 commit comments

Comments
 (0)