зеркало из https://github.com/microsoft/scalar.git
Fold telemetry listener creation to non-platform specific code
Now the telemetry daemon listener is not platform specific, and there is only one listener for telemetry, we can remove the API from `GVFSPlatform` and just construct the `TelemetryDaemonEL` in the `JsonTracer`.
This commit is contained in:
Родитель
cbe5787db2
Коммит
235cf14a49
|
@ -51,8 +51,6 @@ namespace GVFS.Common
|
|||
public abstract bool TryGetGVFSHooksPathAndVersion(out string hooksPaths, out string hooksVersion, out string error);
|
||||
public abstract bool TryInstallGitCommandHooks(GVFSContext context, string executingDirectory, string hookName, string commandHookPath, out string errorMessage);
|
||||
|
||||
public abstract IEnumerable<EventListener> CreateTelemetryListeners(string providerName, string enlistmentId, string mountId);
|
||||
|
||||
public abstract bool TryVerifyAuthenticodeSignature(string path, out string subject, out string issuer, out string error);
|
||||
|
||||
public abstract Dictionary<string, string> GetPhysicalDiskInfo(string path, bool sizeStatsOnly);
|
||||
|
|
|
@ -44,8 +44,20 @@ namespace GVFS.Common.Tracing
|
|||
{
|
||||
if (!disableTelemetry)
|
||||
{
|
||||
IEnumerable<EventListener> telemetryListeners = GVFSPlatform.Instance.CreateTelemetryListeners(providerName, enlistmentId, mountId);
|
||||
this.listeners.AddRange(telemetryListeners);
|
||||
string gitBinRoot = GVFSPlatform.Instance.GitInstallation.GetInstalledGitBinPath();
|
||||
|
||||
// If we do not have a git binary, then we cannot check if we should set up telemetry
|
||||
// We also cannot log this, as we are setting up tracer.
|
||||
if (string.IsNullOrEmpty(gitBinRoot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TelemetryDaemonEventListener daemonListener = TelemetryDaemonEventListener.CreateIfEnabled(gitBinRoot, providerName, enlistmentId, mountId);
|
||||
if (daemonListener != null)
|
||||
{
|
||||
this.listeners.Add(daemonListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,17 +89,6 @@ namespace GVFS.Platform.Mac
|
|||
return pipe;
|
||||
}
|
||||
|
||||
public override IEnumerable<EventListener> CreateTelemetryListeners(string providerName, string enlistmentId, string mountId)
|
||||
{
|
||||
string gitBinRoot = this.GitInstallation.GetInstalledGitBinPath();
|
||||
|
||||
TelemetryDaemonEventListener daemonListener = TelemetryDaemonEventListener.CreateIfEnabled(gitBinRoot, providerName, enlistmentId, mountId);
|
||||
if (daemonListener != null)
|
||||
{
|
||||
yield return daemonListener;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetCurrentUser()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
@ -75,24 +75,6 @@ namespace GVFS.Platform.Windows
|
|||
return true;
|
||||
}
|
||||
|
||||
public override IEnumerable<EventListener> CreateTelemetryListeners(string providerName, string enlistmentId, string mountId)
|
||||
{
|
||||
string gitBinRoot = this.GitInstallation.GetInstalledGitBinPath();
|
||||
|
||||
// If we do not have a git binary, then we cannot check if we should set up telemetry
|
||||
// We also cannot log this, as we are setting up tracer.
|
||||
if (string.IsNullOrEmpty(gitBinRoot))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
TelemetryDaemonEventListener daemonListener = TelemetryDaemonEventListener.CreateIfEnabled(gitBinRoot, providerName, enlistmentId, mountId);
|
||||
if (daemonListener != null)
|
||||
{
|
||||
yield return daemonListener;
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitializeEnlistmentACLs(string enlistmentPath)
|
||||
{
|
||||
// The following permissions are typically present on deskop and missing on Server
|
||||
|
|
|
@ -58,11 +58,6 @@ namespace GVFS.UnitTests.Mock.Common
|
|||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override IEnumerable<EventListener> CreateTelemetryListeners(string providerName, string enlistmentId, string mountId)
|
||||
{
|
||||
yield return new MockListener(EventLevel.Verbose, Keywords.Telemetry);
|
||||
}
|
||||
|
||||
public override string GetCurrentUser()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
|
|
Загрузка…
Ссылка в новой задаче