Class StatKafkaPublisher

Inheritance Relationships

Base Type

Class Documentation

class StatKafkaPublisher : public ska::pst::stat::StatPublisher

An implementation of the StatPublisher class used to generate and send messages to the SDP dashboards via Kafka.

Only one instance of this class is needed in the the StatApplicationManager. The constructor of this class will determine what Kafka dashboards have been configured for the scan and will instantiate the MsgPack strategies, Kafka producers and a StatKafkaMessageSender for each configured dashboard type.

Public Functions

StatKafkaPublisher(const ska::pst::common::AsciiHeader &config, ska::pst::stat::StatKafkaProducerFactory &kafka_producer_factory)

Create instance of a StatKafkaPublisher object.

Parameters
  • config – the configuration current voltage data stream.

  • kafka_producer_factory – the factory used to create instances of StatKafkaProducers, where are in turn used to send the messages to Kafka.

virtual ~StatKafkaPublisher()

Destroy the StatKafkaPublisher object.

virtual void publish(std::shared_ptr<StatStorage> storage) override

publish the current statistics to configured endpoint/location.

Parameters

storage – reference to the computed statistics to publish.

inline const std::map<std::string, std::shared_ptr<StatKafkaMessageSender>> &get_msg_senders()

Get the msg senders that the publisher has been configured for.

Returns

const std::map<std::string, std::shared_ptr<StatKafkaMessageSender>>&

Protected Attributes

std::map<std::string, std::shared_ptr<StatKafkaMessageSender>> msg_senders = {}

The msg senders.