NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Import.DriftFileImporter Class Reference
Collaboration diagram for Ntp.Analyzer.Import.DriftFileImporter:

Public Member Functions

 DriftFileImporter (Host host, string file, ReadingBulk bulk, LogBase log)
 
void Execute ()
 

Properties

DriftReading Reading [get, private set]
 

Private Attributes

readonly ReadingBulk bulk
 
readonly string file
 
readonly Host host
 
readonly LogBase log
 

Detailed Description

Definition at line 29 of file DriftFileImporter.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Import.DriftFileImporter.DriftFileImporter ( Host  host,
string  file,
ReadingBulk  bulk,
LogBase  log 
)
inline

Definition at line 31 of file DriftFileImporter.cs.

32  {
33  this.host = host;
34  this.file = file;
35  this.bulk = bulk;
36  this.log = log;
37  }

Member Function Documentation

void Ntp.Analyzer.Import.DriftFileImporter.Execute ( )
inline

Definition at line 46 of file DriftFileImporter.cs.

References e.

Referenced by Ntp.Analyzer.Process.Description.DriftStatJob.InternalExecute().

47  {
48  StreamReader reader = null;
49  string text;
50 
51  try
52  {
53  reader = new StreamReader(file);
54  text = reader.ReadLine();
55  }
56  catch (Exception e)
57  {
58  log.DriftFileReadError(host.Name, file, e);
59  return;
60  }
61  finally
62  {
63  reader?.Close();
64  }
65 
66  double value;
67  if (double.TryParse(text, out value))
68  {
69  Reading = new DriftReading(host, value, bulk);
70  return;
71  }
72 
73  log.DriftReadError(host.Name, file);
74  }
abstract void Close()
var e
Definition: bootstrap.min.js:6
Value from NTP drift file.
Definition: DriftReading.cs:29

Here is the caller graph for this function:

Member Data Documentation

readonly ReadingBulk Ntp.Analyzer.Import.DriftFileImporter.bulk
private

Definition at line 39 of file DriftFileImporter.cs.

readonly string Ntp.Analyzer.Import.DriftFileImporter.file
private

Definition at line 40 of file DriftFileImporter.cs.

readonly Host Ntp.Analyzer.Import.DriftFileImporter.host
private

Definition at line 41 of file DriftFileImporter.cs.

readonly LogBase Ntp.Analyzer.Import.DriftFileImporter.log
private

Definition at line 42 of file DriftFileImporter.cs.

Property Documentation

DriftReading Ntp.Analyzer.Import.DriftFileImporter.Reading
getprivate set

Definition at line 44 of file DriftFileImporter.cs.


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