def update(event)
      @last_update = {:time => Time.now.to_i, :pid => @pid, :event => event}
      FileUtils.mkdir_p(File.dirname(@history)) unless File.exists?(File.dirname(@history))
      File.open(@history, "a") { |f| f.puts @last_update.to_json }
      true
    end
def update(event)
      @last_update = {:time => Time.now.to_i, :pid => @pid, :event => event}
      FileUtils.mkdir_p(File.dirname(@history)) unless File.exists?(File.dirname(@history))
      File.open(@history, "a") { |f| f.puts @last_update.to_json }
      true
    end
Initialize history

 === Parameters
 identity(String):: Serialized agent identity
 pid(Integer):: Process ID of agent, defaults to ID if current process
 Append event to history file

 === Parameters
 event(Object):: Event to be stored in the form String or {String => Object},
   where String is the event name and Object is any associated JSON-encodable data

 === Return
 true:: Always return true