public void GetServiceStatsReturnsCorrectDefinition() { Run(() => { SearchServiceClient searchClient = Data.GetSearchServiceClient(); var expectedStats = new ServiceStatistics { Counters = new ServiceCounters { DocumentCounter = new ResourceCounter(0, null), IndexCounter = new ResourceCounter(0, 3), IndexerCounter = new ResourceCounter(0, 3), DataSourceCounter = new ResourceCounter(0, 3), StorageSizeCounter = new ResourceCounter(0, 52428800), SynonymMapCounter = new ResourceCounter(0, 3) }, Limits = new ServiceLimits { MaxFieldsPerIndex = 1000, MaxFieldNestingDepthPerIndex = 10, MaxComplexCollectionFieldsPerIndex = 40 } }; ServiceStatistics stats = searchClient.GetServiceStatistics(); Assert.Equal(expectedStats, stats, new ModelComparer <ServiceStatistics>()); }); }
private void OnViewerSelected(object sender, EventArgs e) { ComboBoxItemWithEntity serviceItem = (ComboBoxItemWithEntity)viewer.comboBoxService.SelectedItem; if (serviceItem == null) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.NoServiceSelected); return; } if (statistics != null && statistics.IsVisible) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.ServiceStatisticsViewerOpened); return; } statistics = new ServiceStatistics((ServiceEntity)serviceItem.Entity, control.Session); statistics.ShowDialog(); }
public async Task <Response <ServiceStatistics> > GetServiceStatisticsAsync(RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { using var message = CreateGetServiceStatisticsRequest(requestOptions); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { ServiceStatistics value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); if (document.RootElement.ValueKind == JsonValueKind.Null) { value = null; } else { value = ServiceStatistics.DeserializeServiceStatistics(document.RootElement); } return(Response.FromValue(value, message.Response)); }
private void OnEnable() { arrServiceStats = new ServiceStatistics(); }
public void ServiceStatsValidationTest(ServiceStatistics serviceStatistics, Dictionary <string, string> expected) { Assert.Equal(expected["ContentString"], JsonSerializer.Serialize(serviceStatistics, typeof(ServiceStatistics), NitroServiceSerializerOptions.JsonSerializerOptions)); }