in src/ServiceProfiler.EventPipe.Otel/Microsoft.ApplicationInsights.Profiler.Shared/Services/CustomEventsBuilder.cs [42:63]
public ServiceProfilerIndex CreateServiceProfilerIndex(string fileId, string stampId, DateTimeOffset sessionId, Guid appId, IProfilerSource profilerSource)
{
ServiceProfilerIndex result = new()
{
Timestamp = sessionId.UtcDateTime,
FileId = fileId,
StampId = stampId,
DataCube = StoragePathContract.GetDataCubeNameString(appId),
EtlFileSessionId = TimestampContract.TimestampToString(sessionId),
MachineName = _roleInstanceCache ??= _roleInstanceSource.CloudRoleInstance,
ProcessId = _processId,
Source = profilerSource.Source,
OperatingSystem = Environment.OSVersion.VersionString,
AverageCPUUsage = _resourceUsageSource.GetAverageCPUUsage(),
AverageMemoryUsage = _resourceUsageSource.GetAverageMemoryUsage(),
CloudRoleName = _roleNameCache ??= _roleNameSource.CloudRoleName
};
_logger.LogDebug("Service Profiler Index content: {content}", result);
return result;
}