Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020132Openbravo ERPA. Platformpublic2012-03-28 10:352012-04-02 06:12
alostale 
alostale 
normalminorN/A
closedfixed 
5
 
3.0MP10 
Core
No
0020132: Add process time to usage audit
Currently usage audit is auditing actions performed within the application
(datasuorce fetch/update/remove, process invocations...).

It would be useful to save also the time the action took to be processed, in this way there would be a pointer to slow actions.
N/A
No tags attached.
related to defect 0020124 closed alostale Usage audit is not working for fetch actions 
Issue History
2012-03-28 10:35alostaleNew Issue
2012-03-28 10:35alostaleAssigned To => alostale
2012-03-28 10:35alostaleModules => Core
2012-03-28 10:35alostaleRelationship addedrelated to 0020124
2012-03-28 11:45hgbotCheckin
2012-03-28 11:45hgbotNote Added: 0046809
2012-03-28 11:45hgbotStatusnew => resolved
2012-03-28 11:45hgbotResolutionopen => fixed
2012-03-28 11:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0fc0c86395e62b517e54a156f687b801ccad1877 [^]
2012-03-28 17:46marvintmNote Added: 0046854
2012-03-28 17:46marvintmStatusresolved => new
2012-03-28 17:46marvintmResolutionfixed => open
2012-03-29 08:03hgbotCheckin
2012-03-29 08:03hgbotNote Added: 0046861
2012-03-29 11:36marvintmStatusnew => scheduled
2012-03-29 11:36marvintmfix_in_branch => pi
2012-03-29 11:36marvintmNote Added: 0046869
2012-03-29 11:36marvintmStatusscheduled => resolved
2012-03-29 11:36marvintmResolutionopen => fixed
2012-03-29 11:36marvintmStatusresolved => closed
2012-03-29 11:36marvintmFixed in Version => 3.0MP10
2012-04-02 06:12hudsonbotCheckin
2012-04-02 06:12hudsonbotNote Added: 0047252
2012-04-02 06:12hudsonbotCheckin
2012-04-02 06:12hudsonbotNote Added: 0047263

Notes
(0046809)
hgbot   
2012-03-28 11:45   
Repository: erp/devel/pi
Changeset: 0fc0c86395e62b517e54a156f687b801ccad1877
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 28 11:44:25 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0fc0c86395e62b517e54a156f687b801ccad1877 [^]

fixed issue 20132: Add process time to usage audit

  -Added process_time column to ad_session_usage_audit table to store the time the process
   took to complete.
  -In HSAS, usage audit is saved after calling service in super, so response time can be calculated

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
M src-db/database/model/tables/AD_SESSION_USAGE_AUDIT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
M src/org/openbravo/erpCommon/security/SessionLogin_data.xsql
M src/org/openbravo/erpCommon/security/UsageAudit.java
---
(0046854)
marvintm   
2012-03-28 17:46   
There is a problem currently with the new "process_time" column. Right now the column is numeric, but the query done to the database is trying to insert a String there, and it fails:

ERROR org.openbravo.erpCommon.security.UsageAudit - Error inserting usage audit
javax.servlet.ServletException: @CODE=0@ERROR: column "process_time" is of type numeric but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 263
    at org.openbravo.erpCommon.security.SessionLoginData.insertUsageAudit(SessionLoginData.java:426)
    at org.openbravo.erpCommon.security.UsageAudit.auditActionNoDal(UsageAudit.java:154)
    at org.openbravo.erpCommon.security.UsageAudit.auditActionNoDal(UsageAudit.java:135)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:427)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63)
    at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:123)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

If a to_number() is added to the query, the problem disappears. Alternatively, the type of the column can be changed to character varying.
(0046861)
hgbot   
2012-03-29 08:03   
Repository: erp/devel/pi
Changeset: 9a9b791783b172754fe98a7429d50c66319800b7
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 29 07:55:48 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9a9b791783b172754fe98a7429d50c66319800b7 [^]

related to issue 20132: Added missing casting

---
M src/org/openbravo/erpCommon/security/SessionLogin_data.xsql
---
(0046869)
marvintm   
2012-03-29 11:36   
Last commit fixed the issue
(0047252)
hudsonbot   
2012-04-02 06:12   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7814864461ac [^]

Maturity status: Test
(0047263)
hudsonbot   
2012-04-02 06:12   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7814864461ac [^]

Maturity status: Test