WeatherDataUpdater debug


Debug missing weather data information

  • Check the last time when the cron job to update weather data was invoked. Use the CronJob.fetch() api to get the details.
  • Check for stuck weather map reduce jobs.
  • Check that all WeatherStations were created
   c3Count(<WeatherAware type>, Filter.not.exists("weatherStation")); // should be 0
   <WeatherAware type>.refreshWeatherStations(); // creates any missing WeatherStations
  • Check if a valid timeZone exists on the {@link WeatherStation} with missing weather data. If not,
c3SwitchAll("reference", "prod");
  • Check if {@link WeatherStation} “id” looks valid. The id can assume one of the 3 values in order of precedence: “-”
    or “-” or “INTL$$long”. If the id is not one of these, it indicates the corresponding {@link WeatherAware} may have incorrect data.

  • Make sure latitude/longitude have more than single digit decimal precision. Single decimal point lat/long precision indicates a large city or district.
    The external weather data provider rejects lat/longs with such low precision value.

  • Make sure the latitude/longitude are legitimate. Many a times we have noticed the values of lat/long interchanged causing it to map on a location in Antartica.

  • Make sure there are no invisible characters produced from excel. For example, if there is Zero-width space in Country Names. WeatherStation key may not be correctly generated.

  • Look for “Unable to get weather data using geocode api” in splunk. This means the weather data api of the weather company returned error.

Create weather metric

In case when timezones values are incorrect, what you can do to update them is:

  1. remove the ZipLatLong with id that are same as the zipcodes giving the wrong result
  2. remove the TimeZone field of these weather stations.
  3. use TimeZoneUpdater.updateTZ() to update the result.

if the above does not help, then manually update ZipLatLong with these ids to the desired lat/long values and then do step 2 and 3.