The Invoice object

The Hsp logout method returns an Invoice object. Our Traveling Salesman Problem application class gets & prints an Invoice. As can be seen from the its Application.java file, there are 2 lines of Java code that pertain to the Invoice object:
  1. The Invoice is the return value of the Hsp logout method.
  2. The Invoice class's toString method is used to display the Invoice (the argument of the System.out.println static method).
The output, including the invoice, that results from this JICOS execution is contained in this file: output.txt.

Discussion

The Invoice has the following components:
  • The date & time that the invoice was issued.
  • The date & time that the client registered with the Hosting Service Provider.
  • The date & time that the client unregistered from the Hosting Service Provider.
  • The start time of requested computing.
  • The amount of time (wall clock) that was consumed during the computing phase.
  • Task statistics. The Hosting Service Provider (HSP) gives the following:
    • Task statistics for each Task Class:
      • Number of Task objects that were executed
      • The sum of the execution times for each such Task.
      • The average execution time per Task
    • These Task Class statistics are given for each Host. Also given for each Host (prior to the Task Class statistics ) are 
      • The total number of Task objects executed on the host
      • The total execution time for executing these Task objects
    • These statistics (Task Class and Summary) are given for each TaskServer. This includes one such entry for the TaskServer acting as a Host (to execute Compose Tasks). Each TaskServer summary also includes the number of associated Hosts (not including the TaskServer itself, acting as a Host).
    • These TaskServer statistics are given for each TaskServer.
    • Finally, summary statistics (including Task Class statistics) are provided for the entire Hosting Service Provider.
    • All service components (Hosts, TaskServers, and the HSP) are identified by their IP address and Domain name.
As can be seen from the invoice, there were 2 task servers, each of which had 4 hosts (for each TaskServer, 1 Host is internal).

Invoice object methods

The Invoice object allows JICOS applications not just to receive a String representation of its contents via toString, but also to manipulate those contents directly. The Invoice has accessor methods for its entire contents. The contents of its subsidiary objects also are accessible, so that the JICOS application can do anything it wants with the contents of an Invoice (e.g., store parts of it in a database, plug the invoice contents into a spreadsheet, etc.), right down to the primitive data types. Please see the API to learn about all these accessor methods. This may be useful for programmatic analysis of JICOS resource consumption, by Task Class, for your particular application.

The actual data in the Invoice class will change, as the JICOS system evolves.