| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef COBALT_SRC_LOCAL_AGGREGATION_1_1_AGGREGATION_PROCEDURES_AT_LEAST_ONCE_AGGREGATION_PROCEDURE_H_ |
| #define COBALT_SRC_LOCAL_AGGREGATION_1_1_AGGREGATION_PROCEDURES_AT_LEAST_ONCE_AGGREGATION_PROCEDURE_H_ |
| |
| #include <set> |
| #include <vector> |
| |
| #include "src/lib/statusor/statusor.h" |
| #include "src/local_aggregation_1.1/aggregation_procedures/aggregation_procedure.h" |
| |
| namespace cobalt::local_aggregation { |
| |
| class AtLeastOnceAggregationProcedure : public AggregationProcedure { |
| public: |
| explicit AtLeastOnceAggregationProcedure(const MetricDefinition &metric, |
| const ReportDefinition &report); |
| |
| void UpdateAggregateData(const logger::EventRecord & /*event_record*/, |
| AggregateData *aggregate_data, |
| EventCodeAggregate * /*aggregate*/) override; |
| [[nodiscard]] std::string DebugString() const override; |
| [[nodiscard]] bool IsDaily() const override { return true; } |
| |
| lib::statusor::StatusOr<std::unique_ptr<Observation>> GenerateSingleObservation( |
| const logger::Encoder *encoder, const std::vector<EventCodeAggregate *> & /*aggregates*/ |
| , |
| const std::set<uint32_t> &event_vectors) override; |
| }; |
| |
| } // namespace cobalt::local_aggregation |
| |
| #endif // COBALT_SRC_LOCAL_AGGREGATION_1_1_AGGREGATION_PROCEDURES_AT_LEAST_ONCE_AGGREGATION_PROCEDURE_H_ |