Fauna v10 .NET/C# Driver 1.0.1
 
Loading...
Searching...
No Matches
QueryStats.cs
Go to the documentation of this file.
1using System.Text.Json.Serialization;
2using static Fauna.Core.ResponseFields;
3
4namespace Fauna.Core;
5
9public readonly struct QueryStats
10{
14 [JsonPropertyName(Stats_ComputeOpsFieldName)]
15 public int ComputeOps { get; init; }
16
20 [JsonPropertyName(Stats_ReadOps)]
21 public int ReadOps { get; init; }
22
26 [JsonPropertyName(Stats_WriteOps)]
27 public int WriteOps { get; init; }
28
32 [JsonPropertyName(Stats_QueryTimeMs)]
33 public int QueryTimeMs { get; init; }
34
38 [JsonPropertyName(Stats_ContentionRetries)]
39 public int ContentionRetries { get; init; }
40
44 [JsonPropertyName(Stats_StorageBytesRead)]
45 public int StorageBytesRead { get; init; }
46
50 [JsonPropertyName(Stats_StorageBytesWrite)]
51 public int StorageBytesWrite { get; init; }
52
56 [JsonPropertyName(Stats_RateLimitsHit)]
57 public List<string> RateLimitsHit { get; init; }
58
62 [JsonPropertyName(Stats_ProcessingTimeMs)]
63 public int? ProcessingTimeMs { get; init; }
64
69 public override string ToString()
70 {
71 return $"compute: {ComputeOps}, read: {ReadOps}, write: {WriteOps}, " +
72 $"queryTime: {QueryTimeMs}, retries: {ContentionRetries}, " +
73 $"storageRead: {StorageBytesRead}, storageWrite: {StorageBytesWrite}, " +
74 $"{(ProcessingTimeMs.HasValue ? $"processingTime: {ProcessingTimeMs}, " : "")}" +
75 $"limits: [{string.Join(',', RateLimitsHit)}]";
76 }
77}