require 'fastercsv' module CollectdServer class Datapoint attr_reader :metric_name, :timestamp, :value def initialize(name, timestamp, value) @metric_name, @timestamp, @value = name, timestamp, value end def to_csv to_a.to_csv end def to_a [metric_name, timestamp, value] end end end