Difference between revisions of "Accounting Dashboard"

From Gcube Wiki
Jump to: navigation, search
(Created page with "{| align="right" ||__TOC__ |} In this guide we describe the Accounting Dashboard web interface. == Overview == Accounting Dashboard is a tool for analyzing and displaying ac...")
 
(Access Library)
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
[[Image:AccountingDashboard_Home1.png|thumb|center|800px|Accounting Dashboard, portlet. Main interface.]]
 
[[Image:AccountingDashboard_Home1.png|thumb|center|800px|Accounting Dashboard, portlet. Main interface.]]
  
 +
== Aggregated Accounting ==
 +
 +
The Dashboard relies on the ''accounting-summary-access'' gCube module in order to get reports from the underlying repository.
 +
 +
The repository is a postgres DB registered as a '''Service Endpoint''' with the following gCube Coordinates :
 +
 +
*Category : Database
 +
*Name : AccountingDashboard
 +
 +
In order to maximize flexibility, the ER model is very simple, as shown in the diagram below.
 +
 +
[[Image:Accounting-Dashboard-ER.png|thumb|center|800px|Accounting Dashboard, ER]]
 +
 +
=== Access Library===
 +
 +
Applications aiming to interact with the DB (either for write or read operations) are expected to use the dedicated library distributed with the following maven coordinates :
 +
 +
<source lang="xml">
 +
<groupId>org.gcube.accounting</groupId>
 +
<artifactId>accounting-summary-access</artifactId>
 +
</source>
 +
 +
Source code can be found at [https://code-repo.d4science.org/gCubeSystem/accounting-summary-access.git| code repo.]
 +
 +
 +
The interface ''org.gcube.accounting.accounting.summary.access.AccountingDao'' represents the contract with client applications, exposing all methods required for insertions and queries.
 +
 +
The following code is an example of query submission :
 +
 +
<source lang="java">
 +
AccountingDao dao=AccountingDao.get();
 +
ScopeDescriptor desc =dao.getTree(..);
 +
Instant from = ...
 +
Instant to = ...
 +
Report rep = dao.getReportByScope(desc, from, to, MeasureResolution.MONTHLY);
 +
</source>
 +
 +
 +
The class ScopeDescriptor represents an (arbitrary) aggregation of contexts (see accounting dashboard portlet), which the library interprets to prepare the Report object.
 +
The class Report represents the result of the submitted query, containing a Series of ReportElement, each of which representing a graph of multiple timeseries (see accounting dashbord portlet).
 +
 +
'''NB''' :
 +
The library test cases expect a ''token.properties'' file in classpath defining available gcube-credentials as the following example:
 +
 +
<source lang = "javascript">
 +
/gcube/devNext/NextNext=....
 +
/pred4s/preprod=...
 +
</source>
  
 
<!--
 
<!--

Latest revision as of 15:09, 2 February 2023

In this guide we describe the Accounting Dashboard web interface.

Overview

Accounting Dashboard is a tool for analyzing and displaying accounting information of the D4Science e-Infrastructure.

Accounting Dashboard, portlet. Main interface.

Aggregated Accounting

The Dashboard relies on the accounting-summary-access gCube module in order to get reports from the underlying repository.

The repository is a postgres DB registered as a Service Endpoint with the following gCube Coordinates :

  • Category : Database
  • Name : AccountingDashboard

In order to maximize flexibility, the ER model is very simple, as shown in the diagram below.

Accounting Dashboard, ER

Access Library

Applications aiming to interact with the DB (either for write or read operations) are expected to use the dedicated library distributed with the following maven coordinates :

<groupId>org.gcube.accounting</groupId>
<artifactId>accounting-summary-access</artifactId>

Source code can be found at code repo.


The interface org.gcube.accounting.accounting.summary.access.AccountingDao represents the contract with client applications, exposing all methods required for insertions and queries.

The following code is an example of query submission :

AccountingDao dao=AccountingDao.get();
ScopeDescriptor desc =dao.getTree(..);
Instant from = ...
Instant to = ...
Report rep = dao.getReportByScope(desc, from, to, MeasureResolution.MONTHLY);


The class ScopeDescriptor represents an (arbitrary) aggregation of contexts (see accounting dashboard portlet), which the library interprets to prepare the Report object. The class Report represents the result of the submitted query, containing a Series of ReportElement, each of which representing a graph of multiple timeseries (see accounting dashbord portlet).

NB : The library test cases expect a token.properties file in classpath defining available gcube-credentials as the following example:

/gcube/devNext/NextNext=....
/pred4s/preprod=...