NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Process.Description.DriftStatJob Class Reference

Job which read statistics from an ntp drift file and saves the result to a database. More...

Inheritance diagram for Ntp.Analyzer.Process.Description.DriftStatJob:
Collaboration diagram for Ntp.Analyzer.Process.Description.DriftStatJob:

Public Member Functions

 DriftStatJob (DriftStatConfiguration config, LogBase log)
 
- Public Member Functions inherited from Ntp.Common.Process.JobDescription
override string ToString ()
 Returns a string that represents the current JobDescription. More...
 

Public Attributes

override string JobType => "Drift statistics"
 
override int Priority => 2
 
override ThreadType ThreadType => ThreadType.MultiThreaded
 
- Public Attributes inherited from Ntp.Common.Process.JobDescription
string Name => Configuration.ConfigName
 Gets the name. More...
 

Protected Member Functions

override void InternalExecute ()
 Implementing method for descendants. More...
 
- Protected Member Functions inherited from Ntp.Common.Process.JobDescription
 JobDescription (IJobConfiguration config, LogBase log)
 Initializes a new instance of the JobDescription class. More...
 

Private Attributes

readonly DriftStatConfiguration config
 

Additional Inherited Members

- Package Functions inherited from Ntp.Common.Process.JobDescription
void Execute ()
 Perform execution of this instance. More...
 
- Properties inherited from Ntp.Common.Process.JobDescription
IJobConfiguration Configuration [get]
 Gets the configuration for the job. More...
 
abstract string JobType [get]
 Gets the type of the job as text. More...
 
LogBase Log [get]
 Gets the log to use when registering events. More...
 
abstract int Priority [get]
 Gets the priority to use when scheduling jobs. More...
 
abstract ThreadType ThreadType [get]
 Gets a value indicating whether this JobDescription should run as a single thread. More...
 

Detailed Description

Job which read statistics from an ntp drift file and saves the result to a database.

Definition at line 37 of file DriftStatJob.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Process.Description.DriftStatJob.DriftStatJob ( DriftStatConfiguration  config,
LogBase  log 
)
inline

Definition at line 39 of file DriftStatJob.cs.

40  : base(config, log)
41  {
42  this.config = config;
43  }
readonly DriftStatConfiguration config
Definition: DriftStatJob.cs:45

Member Function Documentation

override void Ntp.Analyzer.Process.Description.DriftStatJob.InternalExecute ( )
inlineprotectedvirtual

Implementing method for descendants.

Implements Ntp.Common.Process.JobDescription.

Definition at line 53 of file DriftStatJob.cs.

References b, Ntp.Analyzer.Import.ImportFactory.CreateDriftImporter(), Ntp.Analyzer.Data.DataFace.DriftReadings, e, Ntp.Analyzer.Import.DriftFileImporter.Execute(), Ntp.Analyzer.Data.DataFace.Hosts, Ntp.Analyzer.Data.DataFace.Instance, and Ntp.Analyzer.Data.DataFace.ReadingBulks.

54  {
55  var host = DataFace.Instance.Hosts.SingleOrDefault(h => h.Id == config.HostId);
56  if (host == null)
57  {
58  Log.HostNotFound(config.HostId);
59  return;
60  }
61 
62  var bulk = config.Bulk == null
63  ? new ReadingBulk(host.Name, config.TimeStamp)
64  : DataFace.Instance.ReadingBulks.Single(b => b.Name == config.Bulk.Name);
65 
67 
68  try
69  {
70  importer.Execute();
71  }
72  catch (Exception e)
73  {
74  Log.HostImportError(e);
75  return;
76  }
77 
78  DataFace.Instance.DriftReadings.Save(importer.Reading);
79  }
HostDatabaseMapper Hosts
Gets the host mapper.
Definition: DataFace.cs:57
LogBase Log
Gets the log to use when registering events.
int HostId
Gets the host identifier in the HostSubConfiguration.
var e
Definition: bootstrap.min.js:6
static DriftFileImporter CreateDriftImporter(string file, ServerType type, Host host, ReadingBulk bulk, LogBase log)
readonly DriftStatConfiguration config
Definition: DriftStatJob.cs:45
Singleton facade class used to access memory persistent data.
Definition: DataFace.cs:30
static DataFace Instance
Gets the Singleton instance.
Definition: DataFace.cs:51
ServerType ServerType
Gets the type of the server in the HostSubConfiguration.
var b
Definition: bootstrap.min.js:6
DriftReadingDatabaseMapper DriftReadings
Gets the host drift reading mapper.
Definition: DataFace.cs:93

Here is the call graph for this function:

Member Data Documentation

readonly DriftStatConfiguration Ntp.Analyzer.Process.Description.DriftStatJob.config
private

Definition at line 45 of file DriftStatJob.cs.

override string Ntp.Analyzer.Process.Description.DriftStatJob.JobType => "Drift statistics"

Definition at line 49 of file DriftStatJob.cs.

override int Ntp.Analyzer.Process.Description.DriftStatJob.Priority => 2

Definition at line 51 of file DriftStatJob.cs.

override ThreadType Ntp.Analyzer.Process.Description.DriftStatJob.ThreadType => ThreadType.MultiThreaded

Definition at line 47 of file DriftStatJob.cs.


The documentation for this class was generated from the following file: