public IndexFailureInformation GetFailureRate(int id) { var key = CreateKey(id); ushort version; var indexStats = Load(tableStorage.IndexingStats, key, out version); var reduceStats = Load(tableStorage.ReduceStats, key, out version); var indexFailureInformation = new IndexFailureInformation { Attempts = indexStats.Value<int>("attempts"), Errors = indexStats.Value<int>("failures"), Successes = indexStats.Value<int>("successes"), ReduceAttempts = reduceStats.Value<int?>("reduce_attempts"), ReduceErrors = reduceStats.Value<int?>("reduce_failures"), ReduceSuccesses = reduceStats.Value<int?>("reduce_successes"), Id = indexStats.Value<int>("index") }; return indexFailureInformation; }
/// <summary> /// Initializes a new instance of the <see cref="IndexDisabledException"/> class. /// </summary> /// <param name="information">The information.</param> public IndexDisabledException(IndexFailureInformation information) { Information = information; }
public IndexFailureInformation GetFailureRate(string index) { var readResult = storage.IndexingStats.Read(index); if (readResult == null) throw new IndexDoesNotExistsException("There is no index named: " + index); var indexFailureInformation = new IndexFailureInformation { Attempts = readResult.Key.Value<int>("attempts"), Errors = readResult.Key.Value<int>("failures"), Successes = readResult.Key.Value<int>("successes"), ReduceAttempts = readResult.Key.Value<int?>("reduce_attempts"), ReduceErrors = readResult.Key.Value<int?>("reduce_failures"), ReduceSuccesses = readResult.Key.Value<int?>("reduce_successes"), Name = readResult.Key.Value<string>("index"), }; return indexFailureInformation; }