001/**002 * Licensed to the Apache Software Foundation (ASF) under one003 * or more contributor license agreements. See the NOTICE file004 * distributed with this work for additional information005 * regarding copyright ownership. The ASF licenses this file006 * to you under the Apache License, Version 2.0 (the007 * "License"); you may not use this file except in compliance008 * with the License. You may obtain a copy of the License at009 *010 * http://www.apache.org/licenses/LICENSE-2.0011 *012 * Unless required by applicable law or agreed to in writing, software013 * distributed under the License is distributed on an "AS IS" BASIS,014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.015 * See the License for the specific language governing permissions and016 * limitations under the License.017 */018019package org.apache.hadoop.metrics2;020021import java.util.Collection;022023import org.apache.hadoop.classification.InterfaceAudience;024import org.apache.hadoop.classification.InterfaceStability;025026/**027 * An immutable snapshot of metrics with a timestamp028 */029@InterfaceAudience.Public030@InterfaceStability.Evolving031public interface MetricsRecord {032 /**033 * Get the timestamp of the metrics034 * @return the timestamp035 */036 long timestamp();037038 /**039 * @return the record name040 */041 String name();042043 /**044 * @return the description of the record045 */046 String description();047048 /**049 * @return the context name of the record050 */051 String context();052053 /**054 * Get the tags of the record055 * Note: returning a collection instead of iterable as we056 * need to use tags as keys (hence Collection#hashCode etc.) in maps057 * @return an unmodifiable collection of tags058 */059 Collection<MetricsTag> tags();060061 /**062 * Get the metrics of the record063 * @return an immutable iterable interface for metrics064 */065 Iterable<AbstractMetric> metrics();066}