Coder Social home page Coder Social logo

paulelong / windows-time-calibration-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/windows-time-calibration-tools

0.0 2.0 0.0 4.64 MB

Window Tools for Calibrating Windows Time Service

License: Other

C# 51.85% C++ 24.08% C 1.27% Batchfile 0.20% PowerShell 22.39% Makefile 0.20%

windows-time-calibration-tools's Introduction

Windows-Time-Calibration-Tools

Window Tools for Calibrating Windows Time Service

The set of tools included are designed to measure and calibrate the Windows time (or for that matter any time) service. It consists of various tools, some of which support the higher level functions. At a high level, they provide the following functions:

  • NtpMonitor Service - Identifies machines to monitor via registry entries which then sends NTP requests. The service uses regular NTP messages and produces logs. The log files can be analyze and charted using the GenerateGraphs.ps1 script in the Scripts directly.
  • Create-MonitorCharts.ps1 - A PowerShell script which produces graphs to observe the accuracy and troubleshoot issues. This tool assume that the source being compared against is local host. For these graphs to be meaningful, localhost must point to a reliable and accurate time source,such as a GPS device. Type "help Create-MonitorCharts.ps1 -full" for guidance.
  • Collect-W32TimeData.ps1 - Collects data using W32Time /RDTSC switch between a system under test and another machine who's clock you can use as a reference.
  • Create-TimeChart.ps1 - Produces a PNG chart from data generated using Collect-W32TimeData
  • OsTimeSampler - A utility that is useful for measuring the performance between a Hyper-V host and it's guests. The tool is run ith both host and guest, for instance OsTimeSampler 1000 500 > Guest1.out. This runs for 500 samples, each 1 second apart. The same command is run on the host. The results...

How to install the tools

Once you built the entire project:

  1. Copy the tools and scripts directory to a single directory
  2. Add that location to your path
  3. Optionally you can add the scripts directly from your github local version to your path.

How to use the tools to observe accuracy

  1. The NtpMonitor services allows you to monitor many machines. By adding registry entries the service immediately sends Ntp messages to the list of servers and records the information in log files. At any time, you can use Create-MonitorCharts to generate charts which display a the offset Delta from a reference and RTT over time. Using this information you can analyze the accuracy and understand if network issues are introducing jitter. This option is good for long term monitoring.

Example Usage:

After adding a server and a reference clock (perhaps your GPS time appliance), you wait for a few hours for data to collect. First create a new directory for your data. After setting up the paths to the powershell tools and GNUPlot, you run "Create-MonitorCharts mySUT myGPSDevice c:\myLogData\logs". The data will be processed for the last days worth of data, and results output describing the accuracy of various percentiles and a graph in the GraphData directory. Old data will be backed up.

  1. If you don't want to install the service, or simply want to measure a single machine, you can generate data using W32Time. The Collect-W32TimeData simplifies the collection, which you can then use Create-TimeChart to create a chart and summary information. This method is good to run shorter term tests, though you can set the number of samples to long periods.

Example Usage:

First you must collect the data for both the system you want to analyze and a reference, (again your GPS time appliance). Use "Collect-W32TimeData mySUT myGPSDevice 500", to automatically invoke w32tm as powershell jobs for both the SUT and reference clock. This examples collects 500 samples, once every second. Once the data is collected, you can generate a chart and summary data by running "Create-TimeChart mySUT myGPSDevice"

  1. You can also observe the accuracy between the host and guest more directly by using the OsTimeSampler tool. It uses the TSC, which is very accurate with short time frames, to bound the time measurement samples. By supply the delta, using the FILLINHERETOOL, and the resulting offset between the host and guest is calculated. This can be used in addition to the tools above, which removes virtualization noise that NTP pings can't avoid as they traverse the network stack.

windows-time-calibration-tools's People

Contributors

alan-jowett avatar msftgits avatar paulelong avatar sm-msft avatar

Watchers

 avatar  avatar

windows-time-calibration-tools's Issues

Change output format to include IP address, expected name, resolved IP address

The output should include an IP address, expected name as columns for each record. This is important because IP addresses can change. The data can then be consumed by IP address or Friendly Name.

Additionally we should include the IP reversed lookup DNS name. This will help diagnose DNS issues when the data is collected.

Change target NTP server configuration changes

Targeting an IP address is preferable in many instances. The friendly name might also be important, but there could be multiple addresses. This change is to allow the configuration to include:
[Name]
IPAddress : REG_SZ
Expected DNS Name: REG_SZ
Polling Frequency: REG_DWORD

Where [Name] is a friendly user defined name for the monitoring target.

Records for servers are silently missing

I noticed I wasn't able to find records for servers we are monitoring. It would be useful to have more information to understand why there is not record recorded.

Reasons could be:

  1. It didn't resolve to any IP address
  2. Server didn't respond to NTP query

We should continue to keep the same format, perhaps adding another column with an error? Perhaps the start/end/time would all be zero as an indication?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.