< Summary - pva.SuperV

Information
Class: pva.SuperV.Engine.HistoryRetrieval.HistoryStatisticRow
Assembly: pva.SuperV.Engine
File(s): /home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Engine/HistoryRetrieval/HistoryStatisticRow.cs
Tag: dotnet-ubuntu_22190969454
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 32
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_StartTime()100%11100%
get_EndTime()100%11100%
get_Duration()100%11100%

File(s)

/home/runner/work/pva.SuperV/pva.SuperV/pva.SuperV.Engine/HistoryRetrieval/HistoryStatisticRow.cs

#LineLine coverage
 1using TDengine.Driver;
 2
 3namespace pva.SuperV.Engine.HistoryRetrieval
 4{
 5    /// <summary>
 6    /// Row of history for a specific timestamp.
 7    /// </summary>
 8    /// <remarks>
 9    /// Builds a row from a TDengine row.
 10    /// </remarks>
 11    /// <param name="row">TDengine row</param>
 12    /// <param name="fields">List of statistic fields.</param>
 13    /// /// <param name="keepFieldType">Whether to convert values to field type or keep as is.</param>
 14    public class HistoryStatisticRow(IRows row, List<HistoryStatisticField> fields, bool keepFieldType)
 6115        : HistoryRow(row, [.. fields.Select(field => field.Field)], keepFieldType)
 16    {
 17        /// <summary>
 18        /// Start time of interval if an interval was specified.
 19        /// </summary>
 5220        public DateTime StartTime { get; } = ((DateTime)row.GetValue(row.FieldCount - 5)).ToUniversalTime();
 21
 22        /// <summary>
 23        /// End time of interval if an interval was specified.
 24        /// </summary>
 5225        public DateTime EndTime { get; } = ((DateTime)row.GetValue(row.FieldCount - 4)).ToUniversalTime();
 26
 27        /// <summary>
 28        /// Duration of interval if an interval was specified.
 29        /// </summary>
 5230        public TimeSpan Duration { get; } = TimeSpan.FromMicroseconds(((long)row.GetValue(row.FieldCount - 3)) / 1000);
 31    }
 32}