예제 #1
0
        private async Task CreateStacksAndEventsAsync()
        {
            var utcNow = SystemClock.UtcNow;

            await CreateDataAsync(d => {
                // matches event1.json / stack1.json
                d.Event()
                .FreeProject()
                .Type(Event.KnownTypes.Log)
                .Level("Error")
                .Source("GET /Print")
                .DateFixed()
                .TotalOccurrences(5)
                .StackReference("http://exceptionless.io")
                .FirstOccurrence(utcNow.SubtractDays(1))
                .Tag("test", "Critical")
                .Geo("40,-70")
                .Value(1.0M)
                .RequestInfoSample()
                .UserIdentity("My-User-Identity", "test user")
                .UserDescription("*****@*****.**", "my custom description")
                .Version("1.2.3.0")
                .ReferenceId("876554321");

                // matches event2.json / stack2.json
                var stack2 = d.Event()
                             .FreeProject()
                             .Type(Event.KnownTypes.Error)
                             .Status(StackStatus.Regressed)
                             .TotalOccurrences(50)
                             .FirstOccurrence(utcNow.SubtractDays(2))
                             .StackReference("https://github.com/exceptionless/Exceptionless")
                             .Tag("Blake Niemyjski")
                             .RequestInfoSample()
                             .UserIdentity("*****@*****.**")
                             .Version("3.2.1-beta1");

                // matches event3.json and using the same stack as the previous event
                d.Event()
                .FreeProject()
                .Type(Event.KnownTypes.Error)
                .Stack(stack2)
                .Tag("Blake Niemyjski")
                .RequestInfoSample()
                .UserIdentity("example", "Blake")
                .Version("4.0.1039 6f929bbe18");

                // defaults everything
                d.Event().FreeProject();
            });

            Log.MinimumLevel = LogLevel.Warning;
            await StackData.CreateSearchDataAsync(GetService <IStackRepository>(), GetService <JsonSerializer>(), true);

            await EventData.CreateSearchDataAsync(GetService <ExceptionlessElasticConfiguration>(), _eventRepository, GetService <EventParserPluginManager>(), true);

            Log.MinimumLevel = LogLevel.Trace;
        }
예제 #2
0
    protected override async Task ResetDataAsync()
    {
        await base.ResetDataAsync();

        var oldLoggingLevel = Log.MinimumLevel;

        Log.MinimumLevel = LogLevel.Warning;

        await StackData.CreateSearchDataAsync(_stackRepository, GetService <JsonSerializer>());

        await EventData.CreateSearchDataAsync(GetService <ExceptionlessElasticConfiguration>(), _eventRepository, GetService <EventParserPluginManager>());

        Log.MinimumLevel = oldLoggingLevel;
    }
예제 #3
0
    public async Task CanGetByStatus()
    {
        Log.MinimumLevel = Microsoft.Extensions.Logging.LogLevel.Trace;
        var organizationRepository = GetService <IOrganizationRepository>();
        var organization           = await organizationRepository.GetByIdAsync(TestConstants.OrganizationId);

        Assert.NotNull(organization);

        await StackData.CreateSearchDataAsync(_repository, GetService <JsonSerializer>(), true);

        var appFilter = new AppFilter(organization);
        var stackIds  = await _repository.GetIdsByQueryAsync(q => q.AppFilter(appFilter).FilterExpression("status:open OR status:regressed").DateRange(DateTime.UtcNow.AddDays(-5), DateTime.UtcNow), o => o.PageLimit(o.GetMaxLimit()));

        Assert.Equal(2, stackIds.Total);
    }
예제 #4
0
        private async Task CreateStacksAndEventsAsync()
        {
            await StackData.CreateSearchDataAsync(GetService <IStackRepository>(), GetService <JsonSerializer>(), true);

            await EventData.CreateSearchDataAsync(GetService <ExceptionlessElasticConfiguration>(), _eventRepository, GetService <EventParserPluginManager>(), true);
        }
예제 #5
0
    protected override async Task ResetDataAsync()
    {
        await base.ResetDataAsync();

        await StackData.CreateSearchDataAsync(_repository, GetService <JsonSerializer>());
    }