protected void record()

in metrics-core/src/main/java/software/amazon/swage/metrics/record/cloudwatch/CloudWatchRecorder.java [386:412]


    protected void record(
            final Metric label,
            final Number value,
            final Unit unit,
            final Instant time,
            final RecorderContext context)
    {
        if (!running.get()) {
            log.debug("record called on shutdown recorder");
            //TODO: something besides silently ignore, perhaps IllegalStateException?
            return;
        }

        if (!isValid(label)) {
            log.warn("Invalid metric name: '" + label + "'");
            return;
        }

        // Metric events will be aggregated, with the individual time of each
        // event lost. Rather than having one timestamp apply to all, we just
        // drop the time information and use the timestamp of aggregation.

        aggregator.add(context,
                       label,
                       value.doubleValue(),
                       unitMapping.get(unit));
    }