use of com.microsoft.applicationinsights.agent.internal.localstorage.LocalFileLoader in project ApplicationInsights-Java by microsoft.
the class TelemetryClient method getStatsbeatChannelBatcher.
public BatchSpanProcessor getStatsbeatChannelBatcher() {
if (statsbeatChannelBatcher == null) {
synchronized (channelInitLock) {
if (statsbeatChannelBatcher == null) {
File statsbeatFolder;
LocalFileLoader localFileLoader = null;
LocalFileWriter localFileWriter = null;
if (!readOnlyFileSystem) {
statsbeatFolder = LocalStorageUtils.getOfflineStatsbeatFolder();
LocalFileCache localFileCache = new LocalFileCache(statsbeatFolder);
localFileLoader = new LocalFileLoader(localFileCache, statsbeatFolder, null);
localFileWriter = new LocalFileWriter(localFileCache, statsbeatFolder, null);
}
TelemetryChannel channel = TelemetryChannel.create(endpointProvider.getStatsbeatEndpointUrl(), localFileWriter, ikeyEndpointMap, statsbeatModule, true, null);
if (!readOnlyFileSystem) {
LocalFileSender.start(localFileLoader, channel);
}
statsbeatChannelBatcher = BatchSpanProcessor.builder(channel).build("statsbeat");
}
}
}
return statsbeatChannelBatcher;
}
use of com.microsoft.applicationinsights.agent.internal.localstorage.LocalFileLoader in project ApplicationInsights-Java by microsoft.
the class TelemetryClient method initChannelBatcher.
private BatchSpanProcessor initChannelBatcher(int exportQueueCapacity, int maxExportBatchSize, String queueName) {
LocalFileLoader localFileLoader = null;
LocalFileWriter localFileWriter = null;
if (!readOnlyFileSystem) {
File telemetryFolder = LocalStorageUtils.getOfflineTelemetryFolder();
LocalFileCache localFileCache = new LocalFileCache(telemetryFolder);
localFileLoader = new LocalFileLoader(localFileCache, telemetryFolder, statsbeatModule.getNonessentialStatsbeat());
localFileWriter = new LocalFileWriter(localFileCache, telemetryFolder, statsbeatModule.getNonessentialStatsbeat());
}
TelemetryChannel channel = TelemetryChannel.create(endpointProvider.getIngestionEndpointUrl(), localFileWriter, ikeyEndpointMap, statsbeatModule, false, aadAuthentication);
if (!readOnlyFileSystem) {
LocalFileSender.start(localFileLoader, channel);
}
return BatchSpanProcessor.builder(channel).setMaxQueueSize(exportQueueCapacity).setMaxExportBatchSize(maxExportBatchSize).setMaxPendingExports(100).build(queueName);
}
Aggregations