001package io.prometheus.metrics.expositionformats; 002 003import com.google.protobuf.Timestamp; 004 005public class ProtobufUtil { 006 007 static Timestamp timestampFromMillis(long timestampMillis) { 008 return Timestamp.newBuilder() 009 .setSeconds(timestampMillis / 1000L) 010 .setNanos((int) (timestampMillis % 1000L * 1000000L)) 011 .build(); 012 } 013}