private void add(HttpServletRequest request,HttpServletResponse response) throws IOException {
  PrintWriter out=response.getWriter();
  String label=request.getParameter("add");
  String units=request.getParameter("units");
  String value=request.getParameter("value");
  String detail=request.getParameter("detail");
  Double val=toDouble(value);
  if (isEmpty(label) || isEmpty(units) || isEmpty(val)) {
    out.println(ERROR + ": add requires that a label, units and numeric value are passed in.  For example: curl http://localhost:8080/jamon/Mon?add=mylabel&units=bytes&value=1234");
    out.println("  Optionally a detail may be passed in: curl http://localhost:8080/jamon/Mon?add=os.mylabel&units=bytes&value=1234&detail=Backup%20script%20from%20host%20backupserver\n");
  }
 else {
    MonKey key=getMonKey(label,detail,units);
    Monitor mon=MonitorFactory.add(key,val);
    out.println(OK + ": add successfully called on - " + label+ " - "+ mon);
  }
}

private void add ( HttpServletRequest request , HttpServletResponse response ) throws IOException { PrintWriter out = response . getWriter ( ) ; String label = request . getParameter ( "add" ) ; String units = request . getParameter ( "units" ) ; String value = request . getParameter ( "value" ) ; String detail = request . getParameter ( "detail" ) ; Double val = toDouble ( value ) ; if ( isEmpty ( label ) || isEmpty ( units ) || isEmpty ( val ) ) { out . println ( ERROR + ": add requires that a label, units and numeric value are passed in.  For example: curl http://localhost:8080/jamon/Mon?add=mylabel&units=bytes&value=1234" ) ; out . println ( "  Optionally a detail may be passed in: curl http://localhost:8080/jamon/Mon?add=os.mylabel&units=bytes&value=1234&detail=Backup%20script%20from%20host%20backupserver\n" ) ; } else { MonKey key = getMonKey ( label , detail , units ) ; Monitor mon = MonitorFactory . add ( key , val ) ; out . println ( OK + ": add successfully called on - " + label + " - " + mon ) ; } }
process calls to add which is an implemetation of a counter or adder .
