@@ -48,6 +48,9 @@ internal class Events
4848 public const string PackageRegistrationRequiredSignerSet = "PackageRegistrationRequiredSignerSet" ;
4949 public const string AccountDeleteCompleted = "AccountDeleteCompleted" ;
5050 public const string AccountDeleteRequested = "AccountDeleteRequested" ;
51+ public const string SymbolPackagePush = "SymbolPackagePush" ;
52+ public const string SymbolPackagePushFailure = "SymbolPackagePushFailure" ;
53+ public const string SymbolPackageGalleryValidation = "SymbolPackageGalleryValidation" ;
5154 }
5255
5356 private IDiagnosticsSource _diagnosticsSource ;
@@ -346,6 +349,21 @@ public void TrackException(Exception exception, Action<Dictionary<string, string
346349 _telemetryClient . TrackException ( exception , telemetryProperties , metrics : null ) ;
347350 }
348351
352+ public void TrackSymbolPackagePushEvent ( string packageId , string packageVersion )
353+ {
354+ TrackMetricForSymbolPackage ( Events . SymbolPackagePush , packageId , packageVersion ) ;
355+ }
356+
357+ public void TrackSymbolPackagePushFailureEvent ( string packageId , string packageVersion )
358+ {
359+ TrackMetricForSymbolPackage ( Events . SymbolPackagePushFailure , packageId , packageVersion ) ;
360+ }
361+
362+ public void TrackSymbolPackageFailedGalleryValidationEvent ( string packageId , string packageVersion )
363+ {
364+ TrackMetricForSymbolPackage ( Events . SymbolPackageGalleryValidation , packageId , packageVersion ) ;
365+ }
366+
349367 private void TrackMetricForAccountActivity ( string eventName , User user , Credential credential , bool wasMultiFactorAuthenticated = false )
350368 {
351369 if ( user == null )
@@ -410,6 +428,22 @@ private static string GetApiKeyCreationDate(User user, IIdentity identity)
410428 return apiKey ? . Created . ToString ( "O" ) ?? "N/A" ;
411429 }
412430
431+ private void TrackMetricForSymbolPackage (
432+ string metricName ,
433+ string packageId ,
434+ string packageVersion ,
435+ Action < Dictionary < string , string > > addProperties = null )
436+ {
437+ TrackMetric ( metricName , 1 , properties => {
438+ properties . Add ( ClientVersion , GetClientVersion ( ) ) ;
439+ properties . Add ( ProtocolVersion , GetProtocolVersion ( ) ) ;
440+ properties . Add ( ClientInformation , GetClientInformation ( ) ) ;
441+ properties . Add ( PackageId , packageId ) ;
442+ properties . Add ( PackageVersion , packageVersion ) ;
443+ addProperties ? . Invoke ( properties ) ;
444+ } ) ;
445+ }
446+
413447 private void TrackMetricForPackage (
414448 string metricName ,
415449 Package package ,
0 commit comments