Files
ntpa/Ntp.Analyzer.Objects/HostIOReading.cs
T
2016-03-06 00:15:13 +01:00

150 lines
5.1 KiB
C#

//
// HostIOReading.cs
//
// Author:
// Carsten Sonne Larsen <cs@innolan.dk>
//
// Copyright (c) 2013 Carsten Sonne Larsen
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using Ntp.Analyzer.Objects.Live;
namespace Ntp.Analyzer.Objects
{
public sealed class HostIOReading : Reading
{
public HostIOReading (
int id,
DateTime time,
Host host,
int timeSinceReset,
int receiveBuffers,
int freeReceiveBuffers,
int usedReceiveBuffers,
int lowWaterRefills,
int droppedPackets,
int ignoredPackets,
int receivedPackets,
int packetsSent,
int packetsNotSent,
int interruptsHandled,
int receivedByInt)
: base (id, time, host, null)
{
this.timeSinceReset = timeSinceReset;
this.receiveBuffers = ReceiveBuffers;
this.freeReceiveBuffers = freeReceiveBuffers;
this.usedReceiveBuffers = usedReceiveBuffers;
this.lowWaterRefills = lowWaterRefills;
this.droppedPackets = droppedPackets;
this.ignoredPackets = ignoredPackets;
this.receivedPackets = receivedPackets;
this.packetsSent = packetsSent;
this.packetsNotSent = packetsNotSent;
this.interruptsHandled = interruptsHandled;
this.receivedByInt = receivedByInt;
}
public HostIOReading (
Host host,
IOStatsEntry entry,
ReadingBulk bulk
)
: base (host, bulk)
{
this.timeSinceReset = entry.TimeSinceReset;
this.receiveBuffers = entry.ReceiveBuffers;
this.freeReceiveBuffers = entry.FreeReceiveBuffers;
this.usedReceiveBuffers = entry.UsedReceiveBuffers;
this.lowWaterRefills = entry.LowWaterRefills;
this.droppedPackets = entry.DroppedPackets;
this.ignoredPackets = entry.IgnoredPackets;
this.receivedPackets = entry.ReceivedPackets;
this.packetsSent = entry.PacketsSent;
this.packetsNotSent = entry.PacketsNotSent;
this.interruptsHandled = entry.InterruptsHandled;
this.receivedByInt = entry.ReceivedByInt;
}
private readonly int timeSinceReset;
private readonly int receiveBuffers;
private readonly int freeReceiveBuffers;
private readonly int usedReceiveBuffers;
private readonly int lowWaterRefills;
private readonly int droppedPackets;
private readonly int ignoredPackets;
private readonly int receivedPackets;
private readonly int packetsSent;
private readonly int packetsNotSent;
private readonly int interruptsHandled;
private readonly int receivedByInt;
public int TimeSinceReset {
get { return timeSinceReset; }
}
public int ReceiveBuffers {
get { return receiveBuffers; }
}
public int FreeReceiveBuffers {
get { return freeReceiveBuffers; }
}
public int UsedReceiveBuffers {
get { return usedReceiveBuffers; }
}
public int LowWaterRefills {
get { return lowWaterRefills; }
}
public int DroppedPackets {
get { return droppedPackets; }
}
public int IgnoredPackets {
get { return ignoredPackets; }
}
public int ReceivedPackets {
get { return receivedPackets; }
}
public int PacketsSent {
get { return packetsSent; }
}
public int PacketsNotSent {
get { return packetsNotSent; }
}
public int InterruptsHandled {
get { return interruptsHandled; }
}
public int ReceivedByInt {
get { return receivedByInt; }
}
}
}