1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #ifndef INVAVGAGGREGATOR_H
4 #define INVAVGAGGREGATOR_H
6 #include "livestatus/table.hpp"
7 #include "livestatus/aggregator.hpp"
15 struct InvAvgAggregatorState final : public AggregatorState
18 double InvAvgCount{0};
24 class InvAvgAggregator final : public Aggregator
27 DECLARE_PTR_TYPEDEFS(InvAvgAggregator);
29 InvAvgAggregator(String attr);
31 void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
32 double GetResultAndFreeState(AggregatorState *state) const override;
37 static InvAvgAggregatorState *EnsureState(AggregatorState **state);
42 #endif /* INVAVGAGGREGATOR_H */