forked from NuGet/NuGetGallery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ece7c7f
commit a581f16
Showing
21 changed files
with
522 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.Tracing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NuGetGallery.Backend.Jobs | ||
{ | ||
public class HelloWorldJob : Job | ||
{ | ||
public string Message { get; set; } | ||
|
||
public override EventSource GetEventSource() | ||
{ | ||
return HelloWorldEventSource.Log; | ||
} | ||
|
||
protected internal override Task Execute() | ||
{ | ||
if (Message.Contains("you suck")) | ||
{ | ||
HelloWorldEventSource.Log.TellingUserTheySuck(); | ||
throw new Exception("NO YOU SUCK!"); | ||
} | ||
HelloWorldEventSource.Log.Hello(Message); | ||
return Task.FromResult<object>(null); | ||
} | ||
|
||
[EventSource(Name = "NuGet-Jobs-HelloWorld")] | ||
public class HelloWorldEventSource : EventSource | ||
{ | ||
public static readonly HelloWorldEventSource Log = new HelloWorldEventSource(); | ||
|
||
private HelloWorldEventSource() { } | ||
|
||
[Event(eventId: 1, Message = "Hello world! Your message: {0}")] | ||
public void Hello(string message) { WriteEvent(1, message); } | ||
|
||
[Event(eventId: 2, Message = "The user said we suck! NO THEY SUCK!")] | ||
public void TellingUserTheySuck() { WriteEvent(2); } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.