Jump to: navigation, search

Difference between revisions of "OSEE/ReqAndDesign"

(Requirements)
Line 9: Line 9:
 
=== Design ===
 
=== Design ===
 
id, timestamp, user, source, type_id, duration, status, details (maybe in JSON format)
 
id, timestamp, user, source, type_id, duration, status, details (maybe in JSON format)
 +
 +
  server uses a queue to collect log entries for a short time (configurable) and then insert them in batch.  This means that any update to a log entry that occurs in less than this configured time will not require a database update (i.e. writing the duration of a short operation).
  
 
log entry types are defined as tokens with a long and name (which is not in db)
 
log entry types are defined as tokens with a long and name (which is not in db)
http://www.precisejava.com/javaperf/j2ee/JDBC.htm#JDBC104
+
[http://www.precisejava.com/javaperf/j2ee/JDBC.htm Optimize JDBC Performance]
 
-7 is used for duration on instantaneous events
 
-7 is used for duration on instantaneous events
 
otherwise the actual duration in ms is updated upon completion (in the meantime -1 is used)
 
otherwise the actual duration in ms is updated upon completion (in the meantime -1 is used)
Line 17: Line 19:
 
== Exception Handeling ==
 
== Exception Handeling ==
 
=== Requirements ===
 
=== Requirements ===
 +
* avoid unnecessary wrapping of exceptions
 
=== Design ===
 
=== Design ===
 +
[http://misko.hevery.com/2009/09/16/checked-exceptions-i-love-you-but-you-have-to-go/ Checked exceptions I love you, but you have to go]
 +
[http://jyops.blogspot.com/2012/03/why-should-you-use-unchecked-exceptions.html Why should you use Unchecked exceptions over Checked exceptions]
 +
[http://convales.blogspot.com/2012/09/clean-code-by-example-checked-versus.html Clean Code by Example: Checked versus unchecked exceptions]
 +
 +
* Use application specific exceptions that extend RuntimeException - application specific allows for setting exception breakpoints in the debugger
 +
* Do not declare any run-time exceptions in any method signatures

Revision as of 15:08, 28 October 2013

Logging

Requirements

  • shall handle thousands of log entries per second
  • log entries shall be quickly accessible based on any combination of server, user, timestamp, log type, duration, status
  • log entries shall be accessible (especially) when an application server is unresponsive
  • log entries shall be available until they are deleted by an admin or admin policy (applied by server automatically)
  • at run-time logging shall be enabled/disabled based on any combination of user, source, and type

Design

id, timestamp, user, source, type_id, duration, status, details (maybe in JSON format)

 server uses a queue to collect log entries for a short time (configurable) and then insert them in batch.  This means that any update to a log entry that occurs in less than this configured time will not require a database update (i.e. writing the duration of a short operation).

log entry types are defined as tokens with a long and name (which is not in db) Optimize JDBC Performance -7 is used for duration on instantaneous events otherwise the actual duration in ms is updated upon completion (in the meantime -1 is used)

Exception Handeling

Requirements

  • avoid unnecessary wrapping of exceptions

Design

Checked exceptions I love you, but you have to go Why should you use Unchecked exceptions over Checked exceptions Clean Code by Example: Checked versus unchecked exceptions

  • Use application specific exceptions that extend RuntimeException - application specific allows for setting exception breakpoints in the debugger
  • Do not declare any run-time exceptions in any method signatures