/*
 * Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hpcloud.mon.common.model.metric;

import java.util.Map;

import com.google.common.base.Preconditions;

/**
 * A metric envelope.
 */
public class MetricEnvelope {
  public Metric metric;
  public Map<String, Object> meta;

  protected MetricEnvelope() {
  }

  public MetricEnvelope(Metric metric) {
    Preconditions.checkNotNull(metric, "metric");
    this.metric = metric;
  }

  public MetricEnvelope(Metric metric, Map<String, Object> meta) {
    Preconditions.checkNotNull(metric, "metric");
    Preconditions.checkNotNull(meta, "meta");
    this.metric = metric;
    this.meta = meta;
  }
}
@@ -857,16 +857,44 @@
 t%3E meta;
+%0A  public long creationTime;
 %0A%0A  prot
@@ -1040,16 +1040,68 @@
 metric;%0A
+    this.creationTime = System.currentTimeMillis();%0A
   %7D%0A%0A  p
@@ -1172,51 +1172,19 @@
     
-Preconditions.checkNotNull(metric, %22metric%22
+this(metric
 );%0A 
@@ -1232,34 +1232,8 @@
 %22);%0A
-    this.metric = metric;%0A
     
@@ -1254,9 +1254,10 @@
 ta;%0A  %7D%0A
-
 %7D
+%0A

Add a timestamp to MetricEnvelope so the Threshold Engine and the Persister can determine the progress of emptying the Kakfa queue