Sha256: d61c2eab0dd382a67da059d4695bf3746a345ed1bed762cc04c75709d886b170
Contents?: true
Size: 968 Bytes
Versions: 1
Compression:
Stored size: 968 Bytes
Contents
# frozen_string_literal: true module ElasticAPM module Transport module Serializers # @api private class MetricsetSerializer < Serializer # rubocop:disable Metrics/MethodLength def build(metricset) payload = { timestamp: metricset.timestamp.to_i, samples: build_samples(metricset.samples) } if metricset.tags? payload[:tags] = mixed_object(metricset.tags) end if metricset.transaction payload[:transaction] = metricset.transaction end if metricset.span payload[:span] = metricset.span end { metricset: payload } end # rubocop:enable Metrics/MethodLength private def build_samples(samples) samples.each_with_object({}) do |(key, value), hsh| hsh[key] = { value: value } end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
elastic-apm-3.2.0 | lib/elastic_apm/transport/serializers/metricset_serializer.rb |