Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -22,50 +22,28 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private int m_Ticks;
|
||||
private BarGraphRenderMode m_RenderMode;
|
||||
public int Ticks { get; set; }
|
||||
|
||||
private string m_xTitle;
|
||||
private string m_yTitle;
|
||||
public BarGraphRenderMode RenderMode { get; set; }
|
||||
|
||||
private int m_FontSize = 7;
|
||||
private int m_Interval = 1;
|
||||
public string xTitle { get; set; }
|
||||
|
||||
private BarRegion[] m_Regions;
|
||||
public string yTitle { get; set; }
|
||||
|
||||
public int Ticks{ get => m_Ticks;
|
||||
set => m_Ticks = value;
|
||||
}
|
||||
public BarGraphRenderMode RenderMode{ get => m_RenderMode;
|
||||
set => m_RenderMode = value;
|
||||
}
|
||||
public int FontSize { get; set; } = 7;
|
||||
|
||||
public string xTitle{ get => m_xTitle;
|
||||
set => m_xTitle = value;
|
||||
}
|
||||
public string yTitle{ get => m_yTitle;
|
||||
set => m_yTitle = value;
|
||||
}
|
||||
public int Interval { get; set; } = 1;
|
||||
|
||||
public int FontSize{ get => m_FontSize;
|
||||
set => m_FontSize = value;
|
||||
}
|
||||
public int Interval{ get => m_Interval;
|
||||
set => m_Interval = value;
|
||||
}
|
||||
|
||||
public BarRegion[] Regions{ get => m_Regions;
|
||||
set => m_Regions = value;
|
||||
}
|
||||
public BarRegion[] Regions { get; set; }
|
||||
|
||||
public BarGraph( string name, string fileName, int ticks, string xTitle, string yTitle, BarGraphRenderMode rm )
|
||||
{
|
||||
m_Name = name;
|
||||
m_FileName = fileName;
|
||||
m_Ticks = ticks;
|
||||
m_xTitle = xTitle;
|
||||
m_yTitle = yTitle;
|
||||
m_RenderMode = rm;
|
||||
Ticks = ticks;
|
||||
this.xTitle = xTitle;
|
||||
this.yTitle = yTitle;
|
||||
RenderMode = rm;
|
||||
}
|
||||
|
||||
private BarGraph()
|
||||
|
|
@ -76,28 +54,28 @@ namespace Server.Engines.Reports
|
|||
{
|
||||
base.SerializeAttributes( op );
|
||||
|
||||
op.SetInt32( "t", m_Ticks );
|
||||
op.SetInt32( "r", (int) m_RenderMode );
|
||||
op.SetInt32( "t", Ticks );
|
||||
op.SetInt32( "r", (int) RenderMode );
|
||||
|
||||
op.SetString( "x", m_xTitle );
|
||||
op.SetString( "y", m_yTitle );
|
||||
op.SetString( "x", xTitle );
|
||||
op.SetString( "y", yTitle );
|
||||
|
||||
op.SetInt32( "s", m_FontSize );
|
||||
op.SetInt32( "i", m_Interval );
|
||||
op.SetInt32( "s", FontSize );
|
||||
op.SetInt32( "i", Interval );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
base.DeserializeAttributes( ip );
|
||||
|
||||
m_Ticks = ip.GetInt32( "t" );
|
||||
m_RenderMode = (BarGraphRenderMode) ip.GetInt32( "r" );
|
||||
Ticks = ip.GetInt32( "t" );
|
||||
RenderMode = (BarGraphRenderMode) ip.GetInt32( "r" );
|
||||
|
||||
m_xTitle = Utility.Intern( ip.GetString( "x" ) );
|
||||
m_yTitle = Utility.Intern( ip.GetString( "y" ) );
|
||||
xTitle = Utility.Intern( ip.GetString( "x" ) );
|
||||
yTitle = Utility.Intern( ip.GetString( "y" ) );
|
||||
|
||||
m_FontSize = ip.GetInt32( "s" );
|
||||
m_Interval = ip.GetInt32( "i" );
|
||||
FontSize = ip.GetInt32( "s" );
|
||||
Interval = ip.GetInt32( "i" );
|
||||
}
|
||||
|
||||
public static int LookupReportValue( Snapshot ss, string reportName, string valueName )
|
||||
|
|
@ -148,7 +126,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
BarGraph barGraph = new BarGraph( "Hourly average " + valueName, "graphs_" + valueName.ToLower() + "_avg", 10, "Time", valueName, BarGraphRenderMode.Lines );
|
||||
|
||||
barGraph.m_FontSize = 6;
|
||||
barGraph.FontSize = 6;
|
||||
|
||||
for ( int i = 7; i <= totals.Length+7; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,15 +13,9 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private string m_Name;
|
||||
private int m_Value;
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Name{ get => m_Name;
|
||||
set => m_Name = value;
|
||||
}
|
||||
public int Value{ get => m_Value;
|
||||
set => m_Value = value;
|
||||
}
|
||||
public int Value { get; set; }
|
||||
|
||||
private ChartItem()
|
||||
{
|
||||
|
|
@ -29,20 +23,20 @@ namespace Server.Engines.Reports
|
|||
|
||||
public ChartItem( string name, int value )
|
||||
{
|
||||
m_Name = name;
|
||||
m_Value = value;
|
||||
Name = name;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetString( "n", m_Name );
|
||||
op.SetInt32( "v", m_Value );
|
||||
op.SetString( "n", Name );
|
||||
op.SetInt32( "v", Value );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
m_Value = ip.GetInt32( "v" );
|
||||
Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
Value = ip.GetInt32( "v" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,17 +13,13 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private bool m_ShowPercents;
|
||||
|
||||
public bool ShowPercents{ get => m_ShowPercents;
|
||||
set => m_ShowPercents = value;
|
||||
}
|
||||
public bool ShowPercents { get; set; }
|
||||
|
||||
public PieChart( string name, string fileName, bool showPercents )
|
||||
{
|
||||
m_Name = name;
|
||||
m_FileName = fileName;
|
||||
m_ShowPercents = showPercents;
|
||||
ShowPercents = showPercents;
|
||||
}
|
||||
|
||||
private PieChart()
|
||||
|
|
@ -34,14 +30,14 @@ namespace Server.Engines.Reports
|
|||
{
|
||||
base.SerializeAttributes( op );
|
||||
|
||||
op.SetBoolean( "p", m_ShowPercents );
|
||||
op.SetBoolean( "p", ShowPercents );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
base.DeserializeAttributes( ip );
|
||||
|
||||
m_ShowPercents = ip.GetBoolean( "p" );
|
||||
ShowPercents = ip.GetBoolean( "p" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,11 @@ namespace Server.Engines.Reports
|
|||
#endregion
|
||||
|
||||
private string m_Value;
|
||||
private string m_Format;
|
||||
|
||||
public string Value{ get => m_Value;
|
||||
set => m_Value = value;
|
||||
}
|
||||
public string Format{ get => m_Format;
|
||||
set => m_Format = value;
|
||||
}
|
||||
public string Format { get; set; }
|
||||
|
||||
private ItemValue()
|
||||
{
|
||||
|
|
@ -34,21 +31,21 @@ namespace Server.Engines.Reports
|
|||
public ItemValue( string value, string format )
|
||||
{
|
||||
m_Value = value;
|
||||
m_Format = format;
|
||||
Format = format;
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetString( "v", m_Value );
|
||||
op.SetString( "f", m_Format );
|
||||
op.SetString( "f", Format );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_Value = ip.GetString( "v" );
|
||||
m_Format = Utility.Intern( ip.GetString( "f" ) );
|
||||
Format = Utility.Intern( ip.GetString( "f" ) );
|
||||
|
||||
if ( m_Format == null )
|
||||
if ( Format == null )
|
||||
Utility.Intern( ref m_Value );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,19 +13,13 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private string m_Name;
|
||||
private string m_Width;
|
||||
private ReportColumnCollection m_Columns;
|
||||
private ReportItemCollection m_Items;
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Name{ get => m_Name;
|
||||
set => m_Name = value;
|
||||
}
|
||||
public string Width{ get => m_Width;
|
||||
set => m_Width = value;
|
||||
}
|
||||
public ReportColumnCollection Columns => m_Columns;
|
||||
public ReportItemCollection Items => m_Items;
|
||||
public string Width { get; set; }
|
||||
|
||||
public ReportColumnCollection Columns { get; }
|
||||
|
||||
public ReportItemCollection Items { get; }
|
||||
|
||||
private Report() : this( null, null )
|
||||
{
|
||||
|
|
@ -33,31 +27,31 @@ namespace Server.Engines.Reports
|
|||
|
||||
public Report( string name, string width )
|
||||
{
|
||||
m_Name = name;
|
||||
m_Width = width;
|
||||
m_Columns = new ReportColumnCollection();
|
||||
m_Items = new ReportItemCollection();
|
||||
Name = name;
|
||||
Width = width;
|
||||
Columns = new ReportColumnCollection();
|
||||
Items = new ReportItemCollection();
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetString( "n", m_Name );
|
||||
op.SetString( "w", m_Width );
|
||||
op.SetString( "n", Name );
|
||||
op.SetString( "w", Width );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
m_Width = Utility.Intern( ip.GetString( "w" ) );
|
||||
Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
Width = Utility.Intern( ip.GetString( "w" ) );
|
||||
}
|
||||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
for ( int i = 0; i < m_Columns.Count; ++i )
|
||||
m_Columns[i].Serialize( op );
|
||||
for ( int i = 0; i < Columns.Count; ++i )
|
||||
Columns[i].Serialize( op );
|
||||
|
||||
for ( int i = 0; i < m_Items.Count; ++i )
|
||||
m_Items[i].Serialize( op );
|
||||
for ( int i = 0; i < Items.Count; ++i )
|
||||
Items[i].Serialize( op );
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
|
|
@ -67,9 +61,9 @@ namespace Server.Engines.Reports
|
|||
PersistableObject child = ip.GetChild();
|
||||
|
||||
if ( child is ReportColumn column )
|
||||
m_Columns.Add( column );
|
||||
Columns.Add( column );
|
||||
else if ( child is ReportItem item )
|
||||
m_Items.Add( item );
|
||||
Items.Add( item );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,19 +13,11 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private string m_Width;
|
||||
private string m_Align;
|
||||
private string m_Name;
|
||||
public string Width { get; set; }
|
||||
|
||||
public string Width{ get => m_Width;
|
||||
set => m_Width = value;
|
||||
}
|
||||
public string Align{ get => m_Align;
|
||||
set => m_Align = value;
|
||||
}
|
||||
public string Name{ get => m_Name;
|
||||
set => m_Name = value;
|
||||
}
|
||||
public string Align { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
private ReportColumn()
|
||||
{
|
||||
|
|
@ -37,23 +29,23 @@ namespace Server.Engines.Reports
|
|||
|
||||
public ReportColumn( string width, string align, string name )
|
||||
{
|
||||
m_Width = width;
|
||||
m_Align = align;
|
||||
m_Name = name;
|
||||
Width = width;
|
||||
Align = align;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetString( "w", m_Width );
|
||||
op.SetString( "a", m_Align );
|
||||
op.SetString( "n", m_Name );
|
||||
op.SetString( "w", Width );
|
||||
op.SetString( "a", Align );
|
||||
op.SetString( "n", Name );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_Width = Utility.Intern( ip.GetString( "w" ) );
|
||||
m_Align = Utility.Intern( ip.GetString( "a" ) );
|
||||
m_Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
Width = Utility.Intern( ip.GetString( "w" ) );
|
||||
Align = Utility.Intern( ip.GetString( "a" ) );
|
||||
Name = Utility.Intern( ip.GetString( "n" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,25 +13,23 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private ItemValueCollection m_Values;
|
||||
|
||||
public ItemValueCollection Values => m_Values;
|
||||
public ItemValueCollection Values { get; }
|
||||
|
||||
public ReportItem()
|
||||
{
|
||||
m_Values = new ItemValueCollection();
|
||||
Values = new ItemValueCollection();
|
||||
}
|
||||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
for ( int i = 0; i < m_Values.Count; ++i )
|
||||
m_Values[i].Serialize( op );
|
||||
for ( int i = 0; i < Values.Count; ++i )
|
||||
Values[i].Serialize( op );
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
{
|
||||
while ( ip.HasChild )
|
||||
m_Values.Add( ip.GetChild() as ItemValue );
|
||||
Values.Add( ip.GetChild() as ItemValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,41 +15,35 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private DateTime m_TimeStamp;
|
||||
private ObjectCollection m_Children;
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
public DateTime TimeStamp{ get => m_TimeStamp;
|
||||
set => m_TimeStamp = value;
|
||||
}
|
||||
public ObjectCollection Children{ get => m_Children;
|
||||
set => m_Children = value;
|
||||
}
|
||||
public ObjectCollection Children { get; set; }
|
||||
|
||||
public Snapshot()
|
||||
{
|
||||
m_Children = new ObjectCollection();
|
||||
Children = new ObjectCollection();
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetDateTime( "t", m_TimeStamp );
|
||||
op.SetDateTime( "t", TimeStamp );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_TimeStamp = ip.GetDateTime( "t" );
|
||||
TimeStamp = ip.GetDateTime( "t" );
|
||||
}
|
||||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
for ( int i = 0; i < m_Children.Count; ++i )
|
||||
m_Children[i].Serialize( op );
|
||||
for ( int i = 0; i < Children.Count; ++i )
|
||||
Children[i].Serialize( op );
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
{
|
||||
while ( ip.HasChild )
|
||||
m_Children.Add( ip.GetChild() );
|
||||
Children.Add( ip.GetChild() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,15 +15,11 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private SnapshotCollection m_Snapshots;
|
||||
|
||||
public SnapshotCollection Snapshots{ get => m_Snapshots;
|
||||
set => m_Snapshots = value;
|
||||
}
|
||||
public SnapshotCollection Snapshots { get; set; }
|
||||
|
||||
public SnapshotHistory()
|
||||
{
|
||||
m_Snapshots = new SnapshotCollection();
|
||||
Snapshots = new SnapshotCollection();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
|
|
@ -52,14 +48,14 @@ namespace Server.Engines.Reports
|
|||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
for ( int i = 0; i < m_Snapshots.Count; ++i )
|
||||
m_Snapshots[i].Serialize( op );
|
||||
for ( int i = 0; i < Snapshots.Count; ++i )
|
||||
Snapshots[i].Serialize( op );
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
{
|
||||
while ( ip.HasChild )
|
||||
m_Snapshots.Add( ip.GetChild() as Snapshot );
|
||||
Snapshots.Add( ip.GetChild() as Snapshot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,22 +5,13 @@ namespace Server.Engines.Reports
|
|||
{
|
||||
public abstract class BaseInfo : IComparable
|
||||
{
|
||||
private static TimeSpan m_SortRange;
|
||||
public static TimeSpan SortRange { get; set; }
|
||||
|
||||
public static TimeSpan SortRange{ get => m_SortRange;
|
||||
set => m_SortRange = value;
|
||||
}
|
||||
|
||||
private string m_Account;
|
||||
private string m_Display;
|
||||
private PageInfoCollection m_Pages;
|
||||
|
||||
public string Account{ get => m_Account;
|
||||
set => m_Account = value;
|
||||
}
|
||||
public PageInfoCollection Pages{ get => m_Pages;
|
||||
set => m_Pages = value;
|
||||
}
|
||||
public string Account { get; set; }
|
||||
|
||||
public PageInfoCollection Pages { get; set; }
|
||||
|
||||
public string Display
|
||||
{
|
||||
|
|
@ -29,9 +20,9 @@ namespace Server.Engines.Reports
|
|||
if ( m_Display != null )
|
||||
return m_Display;
|
||||
|
||||
if ( m_Account != null )
|
||||
if ( Account != null )
|
||||
{
|
||||
IAccount acct = Accounts.GetAccount( m_Account );
|
||||
IAccount acct = Accounts.GetAccount( Account );
|
||||
|
||||
if ( acct != null )
|
||||
{
|
||||
|
|
@ -50,37 +41,37 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
}
|
||||
|
||||
return ( m_Display = m_Account );
|
||||
return ( m_Display = Account );
|
||||
}
|
||||
}
|
||||
|
||||
public int GetPageCount( PageResolution res, DateTime min, DateTime max )
|
||||
{
|
||||
return StaffHistory.GetPageCount( m_Pages, res, min, max );
|
||||
return StaffHistory.GetPageCount( Pages, res, min, max );
|
||||
}
|
||||
|
||||
public BaseInfo( string account )
|
||||
{
|
||||
m_Account = account;
|
||||
m_Pages = new PageInfoCollection();
|
||||
Account = account;
|
||||
Pages = new PageInfoCollection();
|
||||
}
|
||||
|
||||
public void Register( PageInfo page )
|
||||
{
|
||||
m_Pages.Add( page );
|
||||
Pages.Add( page );
|
||||
}
|
||||
|
||||
public void Unregister( PageInfo page )
|
||||
{
|
||||
m_Pages.Remove( page );
|
||||
Pages.Remove( page );
|
||||
}
|
||||
|
||||
public int CompareTo( object obj )
|
||||
{
|
||||
BaseInfo cmp = obj as BaseInfo;
|
||||
|
||||
int v = cmp.GetPageCount( cmp is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - m_SortRange, DateTime.UtcNow )
|
||||
- GetPageCount( this is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - m_SortRange, DateTime.UtcNow );
|
||||
int v = cmp.GetPageCount( cmp is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - SortRange, DateTime.UtcNow )
|
||||
- GetPageCount( this is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - SortRange, DateTime.UtcNow );
|
||||
|
||||
if ( v == 0 )
|
||||
v = string.Compare( Display, cmp.Display );
|
||||
|
|
|
|||
|
|
@ -68,17 +68,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
}
|
||||
|
||||
private PageType m_PageType;
|
||||
private PageResolution m_Resolution;
|
||||
|
||||
private DateTime m_TimeSent;
|
||||
private DateTime m_TimeResolved;
|
||||
|
||||
private string m_SentBy;
|
||||
private string m_ResolvedBy;
|
||||
|
||||
private string m_Message;
|
||||
private ResponseInfoCollection m_Responses;
|
||||
|
||||
public StaffHistory History
|
||||
{
|
||||
|
|
@ -104,15 +94,13 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
}
|
||||
|
||||
public PageType PageType{ get => m_PageType;
|
||||
set => m_PageType = value;
|
||||
}
|
||||
public PageResolution Resolution => m_Resolution;
|
||||
public PageType PageType { get; set; }
|
||||
|
||||
public DateTime TimeSent{ get => m_TimeSent;
|
||||
set => m_TimeSent = value;
|
||||
}
|
||||
public DateTime TimeResolved => m_TimeResolved;
|
||||
public PageResolution Resolution { get; private set; }
|
||||
|
||||
public DateTime TimeSent { get; set; }
|
||||
|
||||
public DateTime TimeResolved { get; private set; }
|
||||
|
||||
public string SentBy
|
||||
{
|
||||
|
|
@ -126,14 +114,11 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
}
|
||||
|
||||
public string ResolvedBy => m_ResolvedBy;
|
||||
public string ResolvedBy { get; private set; }
|
||||
|
||||
public string Message{ get => m_Message;
|
||||
set => m_Message = value;
|
||||
}
|
||||
public ResponseInfoCollection Responses{ get => m_Responses;
|
||||
set => m_Responses = value;
|
||||
}
|
||||
public string Message { get; set; }
|
||||
|
||||
public ResponseInfoCollection Responses { get; set; }
|
||||
|
||||
public void UpdateResolver()
|
||||
{
|
||||
|
|
@ -146,9 +131,9 @@ namespace Server.Engines.Reports
|
|||
else
|
||||
Resolver = null;
|
||||
|
||||
m_ResolvedBy = resolvedBy;
|
||||
m_TimeResolved = timeResolved;
|
||||
m_Resolution = res;
|
||||
ResolvedBy = resolvedBy;
|
||||
TimeResolved = timeResolved;
|
||||
Resolution = res;
|
||||
}
|
||||
|
||||
public bool IsStaffResolution( PageResolution res )
|
||||
|
|
@ -171,9 +156,9 @@ namespace Server.Engines.Reports
|
|||
|
||||
public PageResolution GetResolution( out string resolvedBy, out DateTime timeResolved )
|
||||
{
|
||||
for ( int i = m_Responses.Count - 1; i >= 0; --i )
|
||||
for ( int i = Responses.Count - 1; i >= 0; --i )
|
||||
{
|
||||
ResponseInfo resp = m_Responses[i];
|
||||
ResponseInfo resp = Responses[i];
|
||||
PageResolution res = ResFromResp( resp.Message );
|
||||
|
||||
if ( res != PageResolution.None )
|
||||
|
|
@ -185,7 +170,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
|
||||
resolvedBy = m_SentBy;
|
||||
timeResolved = m_TimeSent;
|
||||
timeResolved = TimeSent;
|
||||
return PageResolution.None;
|
||||
}
|
||||
|
||||
|
|
@ -196,53 +181,53 @@ namespace Server.Engines.Reports
|
|||
|
||||
public PageInfo()
|
||||
{
|
||||
m_Responses = new ResponseInfoCollection();
|
||||
Responses = new ResponseInfoCollection();
|
||||
}
|
||||
|
||||
public PageInfo( PageEntry entry )
|
||||
{
|
||||
m_PageType = entry.Type;
|
||||
PageType = entry.Type;
|
||||
|
||||
m_TimeSent = entry.Sent;
|
||||
TimeSent = entry.Sent;
|
||||
m_SentBy = GetAccount( entry.Sender );
|
||||
|
||||
m_Message = entry.Message;
|
||||
m_Responses = new ResponseInfoCollection();
|
||||
Message = entry.Message;
|
||||
Responses = new ResponseInfoCollection();
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetInt32( "p", (int)m_PageType );
|
||||
op.SetInt32( "p", (int)PageType );
|
||||
|
||||
op.SetDateTime( "ts", m_TimeSent );
|
||||
op.SetDateTime( "ts", TimeSent );
|
||||
op.SetString( "s", m_SentBy );
|
||||
|
||||
op.SetString( "m", m_Message );
|
||||
op.SetString( "m", Message );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_PageType = (PageType) ip.GetInt32( "p" );
|
||||
PageType = (PageType) ip.GetInt32( "p" );
|
||||
|
||||
m_TimeSent = ip.GetDateTime( "ts" );
|
||||
TimeSent = ip.GetDateTime( "ts" );
|
||||
m_SentBy = ip.GetString( "s" );
|
||||
|
||||
m_Message = ip.GetString( "m" );
|
||||
Message = ip.GetString( "m" );
|
||||
}
|
||||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
lock ( this )
|
||||
{
|
||||
for ( int i = 0; i < m_Responses.Count; ++i )
|
||||
m_Responses[i].Serialize( op );
|
||||
for ( int i = 0; i < Responses.Count; ++i )
|
||||
Responses[i].Serialize( op );
|
||||
}
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
{
|
||||
while ( ip.HasChild )
|
||||
m_Responses.Add( ip.GetChild() as ResponseInfo );
|
||||
Responses.Add( ip.GetChild() as ResponseInfo );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,15 +15,9 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private DateTime m_TimeStamp;
|
||||
private int m_Count;
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
public DateTime TimeStamp{ get => m_TimeStamp;
|
||||
set => m_TimeStamp = value;
|
||||
}
|
||||
public int Count{ get => m_Count;
|
||||
set => m_Count = value;
|
||||
}
|
||||
public int Count { get; set; }
|
||||
|
||||
public QueueStatus()
|
||||
{
|
||||
|
|
@ -31,20 +25,20 @@ namespace Server.Engines.Reports
|
|||
|
||||
public QueueStatus( int count )
|
||||
{
|
||||
m_TimeStamp = DateTime.UtcNow;
|
||||
m_Count = count;
|
||||
TimeStamp = DateTime.UtcNow;
|
||||
Count = count;
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetDateTime( "t", m_TimeStamp );
|
||||
op.SetInt32( "c", m_Count );
|
||||
op.SetDateTime( "t", TimeStamp );
|
||||
op.SetInt32( "c", Count );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_TimeStamp = ip.GetDateTime( "t" );
|
||||
m_Count = ip.GetInt32( "c" );
|
||||
TimeStamp = ip.GetDateTime( "t" );
|
||||
Count = ip.GetInt32( "c" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,21 +15,11 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private DateTime m_TimeStamp;
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
private string m_SentBy;
|
||||
private string m_Message;
|
||||
public string SentBy { get; set; }
|
||||
|
||||
public DateTime TimeStamp{ get => m_TimeStamp;
|
||||
set => m_TimeStamp = value;
|
||||
}
|
||||
|
||||
public string SentBy{ get => m_SentBy;
|
||||
set => m_SentBy = value;
|
||||
}
|
||||
public string Message{ get => m_Message;
|
||||
set => m_Message = value;
|
||||
}
|
||||
public string Message { get; set; }
|
||||
|
||||
public ResponseInfo()
|
||||
{
|
||||
|
|
@ -37,25 +27,25 @@ namespace Server.Engines.Reports
|
|||
|
||||
public ResponseInfo( string sentBy, string message )
|
||||
{
|
||||
m_TimeStamp = DateTime.UtcNow;
|
||||
m_SentBy = sentBy;
|
||||
m_Message = message;
|
||||
TimeStamp = DateTime.UtcNow;
|
||||
SentBy = sentBy;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
public override void SerializeAttributes( PersistanceWriter op )
|
||||
{
|
||||
op.SetDateTime( "t", m_TimeStamp );
|
||||
op.SetDateTime( "t", TimeStamp );
|
||||
|
||||
op.SetString( "s", m_SentBy );
|
||||
op.SetString( "m", m_Message );
|
||||
op.SetString( "s", SentBy );
|
||||
op.SetString( "m", Message );
|
||||
}
|
||||
|
||||
public override void DeserializeAttributes( PersistanceReader ip )
|
||||
{
|
||||
m_TimeStamp = ip.GetDateTime( "t" );
|
||||
TimeStamp = ip.GetDateTime( "t" );
|
||||
|
||||
m_SentBy = ip.GetString( "s" );
|
||||
m_Message = ip.GetString( "m" );
|
||||
SentBy = ip.GetString( "s" );
|
||||
Message = ip.GetString( "m" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,41 +17,29 @@ namespace Server.Engines.Reports
|
|||
public override PersistableType TypeID => ThisTypeID;
|
||||
#endregion
|
||||
|
||||
private PageInfoCollection m_Pages;
|
||||
private QueueStatusCollection m_QueueStats;
|
||||
public PageInfoCollection Pages { get; set; }
|
||||
|
||||
private Hashtable m_UserInfo;
|
||||
private Hashtable m_StaffInfo;
|
||||
public QueueStatusCollection QueueStats { get; set; }
|
||||
|
||||
public PageInfoCollection Pages{ get => m_Pages;
|
||||
set => m_Pages = value;
|
||||
}
|
||||
public QueueStatusCollection QueueStats{ get => m_QueueStats;
|
||||
set => m_QueueStats = value;
|
||||
}
|
||||
public Hashtable UserInfo { get; set; }
|
||||
|
||||
public Hashtable UserInfo{ get => m_UserInfo;
|
||||
set => m_UserInfo = value;
|
||||
}
|
||||
public Hashtable StaffInfo{ get => m_StaffInfo;
|
||||
set => m_StaffInfo = value;
|
||||
}
|
||||
public Hashtable StaffInfo { get; set; }
|
||||
|
||||
public void AddPage( PageInfo info )
|
||||
{
|
||||
lock ( SaveLock )
|
||||
m_Pages.Add( info );
|
||||
Pages.Add( info );
|
||||
|
||||
info.History = this;
|
||||
}
|
||||
|
||||
public StaffHistory()
|
||||
{
|
||||
m_Pages = new PageInfoCollection();
|
||||
m_QueueStats = new QueueStatusCollection();
|
||||
Pages = new PageInfoCollection();
|
||||
QueueStats = new QueueStatusCollection();
|
||||
|
||||
m_UserInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
|
||||
m_StaffInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
|
||||
UserInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
|
||||
StaffInfo = new Hashtable( StringComparer.OrdinalIgnoreCase );
|
||||
}
|
||||
|
||||
public StaffInfo GetStaffInfo( string account )
|
||||
|
|
@ -61,8 +49,8 @@ namespace Server.Engines.Reports
|
|||
if ( string.IsNullOrEmpty(account) )
|
||||
return null;
|
||||
|
||||
if ( !(m_StaffInfo[account] is StaffInfo info) )
|
||||
m_StaffInfo[account] = info = new StaffInfo( account );
|
||||
if ( !(StaffInfo[account] is StaffInfo info) )
|
||||
StaffInfo[account] = info = new StaffInfo( account );
|
||||
|
||||
return info;
|
||||
}
|
||||
|
|
@ -73,8 +61,8 @@ namespace Server.Engines.Reports
|
|||
if ( string.IsNullOrEmpty(account) )
|
||||
return null;
|
||||
|
||||
if ( !(m_UserInfo[account] is UserInfo info) )
|
||||
m_UserInfo[account] = info = new UserInfo( account );
|
||||
if ( !(UserInfo[account] is UserInfo info) )
|
||||
UserInfo[account] = info = new UserInfo( account );
|
||||
|
||||
return info;
|
||||
}
|
||||
|
|
@ -111,11 +99,11 @@ namespace Server.Engines.Reports
|
|||
|
||||
public override void SerializeChildren( PersistanceWriter op )
|
||||
{
|
||||
for ( int i = 0; i < m_Pages.Count; ++i )
|
||||
m_Pages[i].Serialize( op );
|
||||
for ( int i = 0; i < Pages.Count; ++i )
|
||||
Pages[i].Serialize( op );
|
||||
|
||||
for ( int i = 0; i < m_QueueStats.Count; ++i )
|
||||
m_QueueStats[i].Serialize( op );
|
||||
for ( int i = 0; i < QueueStats.Count; ++i )
|
||||
QueueStats[i].Serialize( op );
|
||||
}
|
||||
|
||||
public override void DeserializeChildren( PersistanceReader ip )
|
||||
|
|
@ -132,7 +120,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
if ( pageInfo.TimeSent >= min || pageInfo.TimeResolved >= min )
|
||||
{
|
||||
m_Pages.Add( pageInfo );
|
||||
Pages.Add( pageInfo );
|
||||
pageInfo.History = this;
|
||||
}
|
||||
else
|
||||
|
|
@ -144,17 +132,17 @@ namespace Server.Engines.Reports
|
|||
else if ( obj is QueueStatus queueStatus )
|
||||
{
|
||||
if ( queueStatus.TimeStamp >= min )
|
||||
m_QueueStats.Add( queueStatus );
|
||||
QueueStats.Add( queueStatus );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public StaffInfo[] GetStaff()
|
||||
{
|
||||
StaffInfo[] staff = new StaffInfo[m_StaffInfo.Count];
|
||||
StaffInfo[] staff = new StaffInfo[StaffInfo.Count];
|
||||
int index = 0;
|
||||
|
||||
foreach ( StaffInfo staffInfo in m_StaffInfo.Values )
|
||||
foreach ( StaffInfo staffInfo in StaffInfo.Values )
|
||||
staff[index++] = staffInfo;
|
||||
|
||||
return staff;
|
||||
|
|
@ -171,11 +159,11 @@ namespace Server.Engines.Reports
|
|||
BaseInfo.SortRange = TimeSpan.FromDays( 7.0 );
|
||||
Array.Sort( staff );
|
||||
|
||||
objects.Add( GraphHourlyPages( m_Pages, PageResolution.None, "New pages by hour", "graph_new_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( m_Pages, PageResolution.Handled, "Handled pages by hour", "graph_handled_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( m_Pages, PageResolution.Deleted, "Deleted pages by hour", "graph_deleted_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( m_Pages, PageResolution.Canceled, "Canceled pages by hour", "graph_canceled_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( m_Pages, PageResolution.Logged, "Logged-out pages by hour", "graph_logged_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( Pages, PageResolution.None, "New pages by hour", "graph_new_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( Pages, PageResolution.Handled, "Handled pages by hour", "graph_handled_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( Pages, PageResolution.Deleted, "Deleted pages by hour", "graph_deleted_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( Pages, PageResolution.Canceled, "Canceled pages by hour", "graph_canceled_pages_hr" ) );
|
||||
objects.Add( GraphHourlyPages( Pages, PageResolution.Logged, "Logged-out pages by hour", "graph_logged_pages_hr" ) );
|
||||
|
||||
BaseInfo.SortRange = TimeSpan.FromDays( 1.0 );
|
||||
Array.Sort( staff );
|
||||
|
|
@ -231,9 +219,9 @@ namespace Server.Engines.Reports
|
|||
DateTime max = DateTime.UtcNow;
|
||||
DateTime min = max - TimeSpan.FromDays( 7.0 );
|
||||
|
||||
for ( int i = 0; i < m_QueueStats.Count; ++i )
|
||||
for ( int i = 0; i < QueueStats.Count; ++i )
|
||||
{
|
||||
DateTime ts = m_QueueStats[i].TimeStamp;
|
||||
DateTime ts = QueueStats[i].TimeStamp;
|
||||
|
||||
if ( ts >= min && ts < max )
|
||||
{
|
||||
|
|
@ -242,7 +230,7 @@ namespace Server.Engines.Reports
|
|||
|
||||
int hour = time.Hours;
|
||||
|
||||
totals[hour] += m_QueueStats[i].Count;
|
||||
totals[hour] += QueueStats[i].Count;
|
||||
counts[hour]++;
|
||||
}
|
||||
}
|
||||
|
|
@ -386,11 +374,11 @@ namespace Server.Engines.Reports
|
|||
|
||||
PieChart resChart = new PieChart( title + " Resolutions", fname + "_resol", true );
|
||||
|
||||
int countTotal = GetPageCount( m_Pages, PageResolution.None, min, max );
|
||||
int countHandled = GetPageCount( m_Pages, PageResolution.Handled, min, max );
|
||||
int countDeleted = GetPageCount( m_Pages, PageResolution.Deleted, min, max );
|
||||
int countCanceled = GetPageCount( m_Pages, PageResolution.Canceled, min, max );
|
||||
int countLogged = GetPageCount( m_Pages, PageResolution.Logged, min, max );
|
||||
int countTotal = GetPageCount( Pages, PageResolution.None, min, max );
|
||||
int countHandled = GetPageCount( Pages, PageResolution.Handled, min, max );
|
||||
int countDeleted = GetPageCount( Pages, PageResolution.Deleted, min, max );
|
||||
int countCanceled = GetPageCount( Pages, PageResolution.Canceled, min, max );
|
||||
int countLogged = GetPageCount( Pages, PageResolution.Logged, min, max );
|
||||
int countUnres = countTotal - ( countHandled + countDeleted + countCanceled + countLogged );
|
||||
|
||||
resChart.Items.Add( "Handled", countHandled );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue