Difference between revisions of "Projects/Skrooge"

Jump to: navigation, search
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Skrooge}}
 
  
{| border="0" cellspacing="1" cellpadding="1"
+
 
 +
{| cellspacing="1" cellpadding="1" border="0"
 
|-
 
|-
 
| [[Image:SkroogeReport.png|left]]  
 
| [[Image:SkroogeReport.png|left]]  
| Skrooge is a personal finances manager for KDE4, aiming at being simple and intuitive. It allows you to keep track of your expenses and incomes, categorize them, and build reports of them.  
+
| Skrooge is a personal finances manager for KDE4, aiming at being simple and intuitive. It allows you to keep track of your expenses and incomes, categorize them, and build reports of them. [http://userbase.kde.org/skrooge Learn more...<br>]
 
Skrooge is a part of [http://extragear.kde.org KDE Extragear], in the Office module  
 
Skrooge is a part of [http://extragear.kde.org KDE Extragear], in the Office module  
  
 
|}
 
|}
  
== How to debug ==
+
This page is dedicated to developpers or advanced users who wish to have a deeper understanding of Skrooge.
 +
 
 +
== Compiling  ==
 +
 
 +
Before we start, please consider using a precompiled package for your distro. You should only be compiling yourself if there is no package yet for your distro, or if you want the latest version, directly from the developpers.
 +
 
 +
=== Get the Sources  ===
 +
 
 +
First, you will need to get the Skrooge source code. There are two ways to do this.
 +
 
 +
==== Latest Release  ====
 +
 
 +
You can [http://skrooge.org/download download the archive file] containing the source code, and extract its content using your favorite extraction tool, such as [http://userbase.kde.org/ark Ark].
 +
 
 +
==== Development Version  ====
 +
 
 +
Skrooge code is stored in KDE's git system. It can be found in http://projects.kde.org/projects/extragear/office/skrooge
 +
 
 +
=== Dependencies  ===
 +
 
 +
To be able to compile and run Skrooge, you will need some additional components
 +
 
 +
==== KDE4 Headers  ====
 +
 
 +
Skrooge being a KDE4 application, it depends on many things in the KDE headers. You can get them from your distribution's packages (name usually contains KDE4+devel, KDE4+headers), or [http://techbase.kde.org/Getting_Started/Sources/Using_Subversion_with_KDE directly from KDE repositories].
 +
 
 +
==== QCA  ====
 +
 
 +
[http://delta.affinix.com/qca/ Qt Cryptographic Architecture]. Get it from your distribution packages.
 +
 
 +
==== libofx  ====
 +
 
 +
A [http://libofx.sourceforge.net/ library] to handle import for OFX files. Get it from your distribution packages.
 +
 
 +
==== Grantlee ====
 +
[http://www.gitorious.org/grantlee/pages/Home Grantlee] is a templating system, used to format the monthly reports. Get it from your distribution packages.
 +
 
 +
=== Build &amp; Install  ===
 +
 
 +
Place yourself in the directory containing the source code, and create a directory named "build" (This is useful to segregate built files from the source code). Open a [http://userbase.kde.org/konsole Konsole] in this directory, and run the following commands (as a normal user)&nbsp;:
 +
 
 +
<syntaxhighlight lang="text">
 +
mkdir build && cd build
 +
cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
 +
make
 +
</syntaxhighlight>
 +
 
 +
(please note the backquotes in the cmake command, they are important...)
 +
 
 +
Then, with root privileges&nbsp;:
 +
 
 +
<syntaxhighlight lang="text">
 +
make install
 +
</syntaxhighlight>
 +
 
 +
=== Uninstall  ===
 +
 
 +
Tried Skrooge but didn't like it&nbsp;? Sorry to hear this... You can uninstall it by running this command in the aforementionned "build" directory, with root privileges&nbsp;:
 +
 
 +
<syntaxhighlight lang="text">
 +
make uninstall
 +
</syntaxhighlight>
 +
 
 +
<br>
 +
 
 +
== Debugging ==
  
 
=== Trace activation  ===
 
=== Trace activation  ===
  
To activate traces, you just have to export an environment variable in your console:  
+
To activate traces, you need to export an environment variable in your console:  
  
'''export SKGTRACE=XX'''
+
export SKGTRACE=XX
  
''XX is the level of traces you want. (0&lt;=XX&lt;=20, 10 is correct)''
+
'''XX''' is the level of traces you want. It should be an integer between 0 and 20. The higher the number, the higher the quantity of information you get. 10 is good compromise.
 +
 
 +
Then, start Skrooge from this console. This will display a lot of information in your terminal, giving you hints as to what could be going wrong if you face issues.
  
 
=== Profiling  ===
 
=== Profiling  ===
  
To activate the basic profiling mechanism included in Skrooge, you just have to export an environment variable in your console:  
+
To activate the basic profiling mechanism included in Skrooge, you need to export an environment variable in your console:  
  
'''export SKGTRACEPERFO=1'''
+
export SKGTRACEPERFO=1  
  
Then, you can find two new commands in Skrooge:  
+
Once Skrooge is started from this console, you can find two new commands:  
  
 
*'''Restart profiling''' (CTRL+Pause) to initialize the profiling  
 
*'''Restart profiling''' (CTRL+Pause) to initialize the profiling  
 
*'''Open profiling''' (ALT+Pause) to open the result of the profiling
 
*'''Open profiling''' (ALT+Pause) to open the result of the profiling
  
Then you will get something like this:  
+
Profiling results look like this:  
<blockquote><sub>method , nb call , millisecondes , average , min , max , '''own time''' , average own time SKGMainPanel::setNewTabContent-addTab , 1 , 38.26897848 , 38.26897848 , 38.26897848 , 38.26897848 , '''25.6370585''' , 25.6370585<br> SKGObjectModelBase::refresh , 2 , 8.741794825 , 4.370897412 , 0.9698964357 , 7.771898389 , 8.147958875 , 4.073979437 <br> SKGMainPanel::setNewTabContent , 1 , 49.36599612 , 49.36599612 , 49.36599612 , 49.36599612 , 3.772916079 , 3.772916079 <br> SKGOperationBoardWidget::SKGOperationBoardWidget , 1 , 3.179117203 , 3.179117203 , 3.179117203 , 3.179117203 , 2.963078141 , 2.963078141 <br> SKGMainPanel::onOpenContext , 1 , 50.43999612 , 50.43999612 , 50.43999612 , 50.43999612 , 1.074000001 , 1.074000001<br> ...</sub></blockquote>
+
 
 +
method , nb call , millisecondes , average , min , max , '''own time''' , average own time  
 +
SKGMainPanel::setNewTabContent-addTab , 1 , 38.26897848 , 38.26897848 , 38.26897848 , 38.26897848 , '''25.6370585''' , 25.6370585
 +
SKGObjectModelBase::refresh , 2 , 8.741794825 , 4.370897412 , 0.9698964357 , 7.771898389 , 8.147958875 , 4.073979437  
 +
SKGMainPanel::setNewTabContent , 1 , 49.36599612 , 49.36599612 , 49.36599612 , 49.36599612 , 3.772916079 , 3.772916079  
 +
SKGOperationBoardWidget::SKGOperationBoardWidget , 1 , 3.179117203 , 3.179117203 , 3.179117203 , 3.179117203 , 2.963078141 , 2.963078141  
 +
SKGMainPanel::onOpenContext , 1 , 50.43999612 , 50.43999612 , 50.43999612 , 50.43999612 , 1.074000001 , 1.074000001
 +
...
 +
 
 
'''Remark:''' If '''SKGTRACE''' is set then you will be able to find the execution time of each methods in traces.  
 
'''Remark:''' If '''SKGTRACE''' is set then you will be able to find the execution time of each methods in traces.  
  
To profile only sql order, you just have to export an environment variable in your console:  
+
To profile only sql instructions, you can export an environment variable in your console:  
  
'''export SKGTRACESQL=XX'''
+
export SKGTRACESQL=XX
  
''Only sql order with an execution time greater then XX ms will be displayed in console.''
+
Only sql order with an execution time greater then '''XX '''ms will be displayed in console.  
  
 
In the console, you will get something like:  
 
In the console, you will get something like:  
<blockquote><sub>executeSqliteOrder&nbsp;:SELECT t_name, t_TYPENLS, f_CURRENTAMOUNT, t_close from v_account_display WHERE (t_type='C' OR t_type='D' OR t_type='I' OR t_type='O') ORDER BY t_TYPENLS, t_name TIME='''441 ms'''</sub></blockquote>
+
 
 +
executeSqliteOrder&nbsp;: SELECT t_name, t_TYPENLS, f_CURRENTAMOUNT, t_close from v_account_display WHERE (t_type='C' OR t_type='D' OR t_type='I' OR t_type='O') ORDER BY t_TYPENLS, t_name TIME='441 ms'
 +
  
 
=== Interactive mode  ===
 
=== Interactive mode  ===
 +
 +
[[Category:Skrooge]]

Latest revision as of 14:41, 18 July 2012


SkroogeReport.png
Skrooge is a personal finances manager for KDE4, aiming at being simple and intuitive. It allows you to keep track of your expenses and incomes, categorize them, and build reports of them. Learn more...

Skrooge is a part of KDE Extragear, in the Office module

This page is dedicated to developpers or advanced users who wish to have a deeper understanding of Skrooge.

Contents

[edit] Compiling

Before we start, please consider using a precompiled package for your distro. You should only be compiling yourself if there is no package yet for your distro, or if you want the latest version, directly from the developpers.

[edit] Get the Sources

First, you will need to get the Skrooge source code. There are two ways to do this.

[edit] Latest Release

You can download the archive file containing the source code, and extract its content using your favorite extraction tool, such as Ark.

[edit] Development Version

Skrooge code is stored in KDE's git system. It can be found in http://projects.kde.org/projects/extragear/office/skrooge

[edit] Dependencies

To be able to compile and run Skrooge, you will need some additional components

[edit] KDE4 Headers

Skrooge being a KDE4 application, it depends on many things in the KDE headers. You can get them from your distribution's packages (name usually contains KDE4+devel, KDE4+headers), or directly from KDE repositories.

[edit] QCA

Qt Cryptographic Architecture. Get it from your distribution packages.

[edit] libofx

A library to handle import for OFX files. Get it from your distribution packages.

[edit] Grantlee

Grantlee is a templating system, used to format the monthly reports. Get it from your distribution packages.

[edit] Build & Install

Place yourself in the directory containing the source code, and create a directory named "build" (This is useful to segregate built files from the source code). Open a Konsole in this directory, and run the following commands (as a normal user) :

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
make

(please note the backquotes in the cmake command, they are important...)

Then, with root privileges :

make install

[edit] Uninstall

Tried Skrooge but didn't like it ? Sorry to hear this... You can uninstall it by running this command in the aforementionned "build" directory, with root privileges :

make uninstall


[edit] Debugging

[edit] Trace activation

To activate traces, you need to export an environment variable in your console:

export SKGTRACE=XX

XX is the level of traces you want. It should be an integer between 0 and 20. The higher the number, the higher the quantity of information you get. 10 is good compromise.

Then, start Skrooge from this console. This will display a lot of information in your terminal, giving you hints as to what could be going wrong if you face issues.

[edit] Profiling

To activate the basic profiling mechanism included in Skrooge, you need to export an environment variable in your console:

export SKGTRACEPERFO=1 

Once Skrooge is started from this console, you can find two new commands:

  • Restart profiling (CTRL+Pause) to initialize the profiling
  • Open profiling (ALT+Pause) to open the result of the profiling

Profiling results look like this:

method , nb call , millisecondes , average , min , max , own time , average own time 
SKGMainPanel::setNewTabContent-addTab , 1 , 38.26897848 , 38.26897848 , 38.26897848 , 38.26897848 , 25.6370585 , 25.6370585
SKGObjectModelBase::refresh , 2 , 8.741794825 , 4.370897412 , 0.9698964357 , 7.771898389 , 8.147958875 , 4.073979437 
SKGMainPanel::setNewTabContent , 1 , 49.36599612 , 49.36599612 , 49.36599612 , 49.36599612 , 3.772916079 , 3.772916079 
SKGOperationBoardWidget::SKGOperationBoardWidget , 1 , 3.179117203 , 3.179117203 , 3.179117203 , 3.179117203 , 2.963078141 , 2.963078141 
SKGMainPanel::onOpenContext , 1 , 50.43999612 , 50.43999612 , 50.43999612 , 50.43999612 , 1.074000001 , 1.074000001
...

Remark: If SKGTRACE is set then you will be able to find the execution time of each methods in traces.

To profile only sql instructions, you can export an environment variable in your console:

export SKGTRACESQL=XX  

Only sql order with an execution time greater then XX ms will be displayed in console.

In the console, you will get something like:

executeSqliteOrder : SELECT t_name, t_TYPENLS, f_CURRENTAMOUNT, t_close from v_account_display WHERE (t_type='C' OR t_type='D' OR t_type='I' OR t_type='O') ORDER BY t_TYPENLS, t_name TIME='441 ms'

[edit] Interactive mode


This page was last modified on 18 July 2012, at 14:41. This page has been accessed 9,368 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal