Search in sources :

Example 1 with ProcessIdentifier

use of io.opencensus.proto.agent.common.v1.ProcessIdentifier in project instrumentation-java by census-instrumentation.

the class OcAgentNodeUtilsTest method getProcessIdentifier.

@Test
public void getProcessIdentifier() {
    String jvmName = "54321@my.org";
    Timestamp timestamp = Timestamp.create(10, 20);
    ProcessIdentifier processIdentifier = OcAgentNodeUtils.getProcessIdentifier(jvmName, timestamp);
    assertThat(processIdentifier.getHostName()).isEqualTo("my.org");
    assertThat(processIdentifier.getPid()).isEqualTo(54321);
    assertThat(processIdentifier.getStartTimestamp()).isEqualTo(com.google.protobuf.Timestamp.newBuilder().setSeconds(10).setNanos(20).build());
}
Also used : Timestamp(io.opencensus.common.Timestamp) ProcessIdentifier(io.opencensus.proto.agent.common.v1.ProcessIdentifier) Test(org.junit.Test)

Aggregations

Timestamp (io.opencensus.common.Timestamp)1 ProcessIdentifier (io.opencensus.proto.agent.common.v1.ProcessIdentifier)1 Test (org.junit.Test)1