/** * Serializes the beginning of this object to the passed in writer. * @param writer The writer to serialize this object to. */ protected void serializeContent(JsonTelemetryDataSerializer writer) throws IOException { writer.write("level", level); writer.writeRequired("method", method, 1024); writer.write("assembly", assembly, 1024); writer.write("fileName", fileName, 1024); writer.write("line", line); }
/** * Initializes a new instance. * @param stackSize The max stack size to report. * @param exception The exception to track. */ public ExceptionTelemetry(Throwable exception, int stackSize) { this(); setException(exception, stackSize); }
/** * Serializes the beginning of this object to the passed in writer. * @param writer The writer to serialize this object to. */ protected void serializeContent(JsonTelemetryDataSerializer writer) throws IOException { writer.writeRequired("baseType", baseType, 1000); }
/** * Gets a dictionary of application-defined property names and values providing additional information about this event. * * @return The properties */ @Override public Map<String, String> getProperties() { return this.context.getProperties(); }
private OperationContext createAndInitializeTelemetry() { TraceTelemetry telemetry = new TraceTelemetry(); defaultInitializer.initialize(telemetry); return telemetry.getContext().getOperation(); }
private void initializeInstrumentationKey(final TelemetryContext context, final boolean isDeveloperMode) { if (isDeveloperMode) { context.setInstrumentationKey("149da81b-a0ab-4bdf-a7e9-11e5af9e39bd"); } else { context.setInstrumentationKey("0f243a28-b3c3-41f2-b7cc-d10feec45a81"); } }
private SessionStateTelemetry getSessionStateTelemetryWithState(SessionState state) { List<SessionStateTelemetry> items = channel.getTelemetryItems(SessionStateTelemetry.class); for (SessionStateTelemetry telemetry : items) { if (telemetry.getSessionState().compareTo(state) == 0) { return telemetry; } } return null; }
/** * Initializes a new instance. * * @param name The event's name. Max length 150. */ public EventTelemetry(String name) { this(); this.setName(name); }
/** * Initializes an instance with a 'name' * @param name The dependency name. */ public RemoteDependencyTelemetry(String name) { this(); setName(name); }
@Test public void testCtor() { SessionStateTelemetry telemetry = new SessionStateTelemetry(SessionState.End); verifyStateAfterCtor(telemetry, SessionState.End); }