@staticmethod
  def _RecordAttempt(instances, instance_name, key_when, key_count):
    """Record an event.

    @type instances: dict
    @param instances: contains instance data indexed by instance_name

    @type instance_name: string
    @param instance_name: name of the instance involved in the event

    @type key_when:
    @param key_when: dict key for the information for when the event occurred

    @type key_count: int
    @param key_count: dict key for the information for how many times
                      the event occurred

    """
    instance = instances.setdefault(instance_name, {})
    instance[key_when] = time.time()
    instance[key_count] = instance.get(key_count, 0) + 1
dataset/ETHPy150Open ganeti/ganeti/lib/watcher/state.py/WatcherState._RecordAttempt/original