File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -382,12 +382,12 @@ private void ExecInternalComplete2(string values)
382382 }
383383
384384 [ MethodImpl ( MethodImplOptions . PreserveSig | MethodImplOptions . NoInlining | MethodImplOptions . NoOptimization ) ]
385- public void SetEnvironmentName ( string environmentName )
385+ public static void SetEnvironmentName ( string environmentName )
386386 {
387387 }
388388
389389 [ MethodImpl ( MethodImplOptions . PreserveSig | MethodImplOptions . NoInlining | MethodImplOptions . NoOptimization ) ]
390- public void SetApplicationName ( string applicationName )
390+ public static void SetApplicationName ( string applicationName )
391391 {
392392 }
393393 }
Original file line number Diff line number Diff line change 2828 <PackageReference Include =" System.Net.Sockets" Version =" 4.3.0" />
2929 </ItemGroup >
3030
31+ <ItemGroup >
32+ <None Update =" Stackify.json" >
33+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
34+ </None >
35+ </ItemGroup >
36+
3137 <PropertyGroup Condition =" '$(TargetFramework)' == 'netstandard2.0' " >
3238 <DefineConstants >NETCORE</DefineConstants >
3339 </PropertyGroup >
Original file line number Diff line number Diff line change @@ -40,7 +40,18 @@ static void Main(string[] args)
4040 Console . WriteLine ( $ "Stackify Config AppName: { StackifyLib . Config . AppName } ") ;
4141 Console . WriteLine ( $ "Stackify Config EnvironmentName: { StackifyLib . Config . Environment } ") ;
4242 Console . WriteLine ( $ "Stackify Config ApiKey: { StackifyLib . Config . ApiKey } ") ;
43+
44+ StackifyLib . ProfileTracer . SetApplicationName ( "Test Name" ) ;
45+ StackifyLib . ProfileTracer . SetEnvironmentName ( "Test Environment" ) ;
46+
47+ var tracer = StackifyLib . ProfileTracer . CreateAsOperation ( "Operation Name" , Trace . CorrelationManager . ActivityId . ToString ( ) ) ;
48+ tracer . Exec ( ( ) => //FYI, async code is also supported via tracer.ExecAsync()
49+ {
50+ //Do some stuff here
51+ Task . Delay ( 1000 ) . GetAwaiter ( ) . GetResult ( ) ;
52+ } ) ;
4353 StackifyLib . Logger . Shutdown ( ) ; //best practice for console apps
54+ Console . ReadLine ( ) ;
4455 }
4556
4657
Original file line number Diff line number Diff line change 1+ {
2+ "profiles" : {
3+ "CoreConsoleApp" : {
4+ "commandName" : " Project" ,
5+ "environmentVariables" : {
6+ "COR_ENABLE_PROFILING" : " 1" ,
7+ "CORECLR_ENABLE_PROFILING" : " 1"
8+ }
9+ }
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments