File: HACKING.pod

package info (click to toggle)
munin 2.0.25-1+deb8u3~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 6,184 kB
  • sloc: perl: 11,818; sh: 3,545; java: 1,880; makefile: 767; python: 272
file content (147 lines) | stat: -rw-r--r-- 2,610 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# this is in pod format (try `perldoc HACKING.pod`)

=pod

=head1 NAME

HACKING.pod - contributing to Munin

=head1 SYNOPSIS

This is the guide for Munin internals contributors (developers,
testers, documenters.)

If you are looking for more information on how to I<use> Munin you
probably want L<http://munin-monitoring.org/wiki/Documentation>
instead.

The munin code is marked by years on the battle front. You will
therefore find code that deviates from the guidelines defined
here. However, all new code should be made to comply.

These guidelines are an RFC for the time being and are of course
negotiable.


=head1 GETTING STARTED

In the dev_script directory you will find scripts that are meant to be
useful for developing. Most of them are tools for creating and using
munin in a sandbox.

=head2 THE SANDBOX

=over

=item B<install>

To make a clean rebuild of the sandbox

 ./dev_scripts/install 1

To just install the latest changes

 ./dev_scripts/install

=item B<enable/disable tls>

To test TLS, you can enable a paranoid TLS configuration by running:

 ./dev_scripts/enable_tls

And disable it with:

 ./dev_scripts/disable_tls

=item B<start/stop munin-node>

 ./dev_scripts/start_munin-node [munin-node params ...]

And

 ./dev_scripts/stop_munin-node

To do both:

 ./dev_scripts/restart_munin-node [munin-node params ...]


=item B<query_munin_node>

Use this command to query the munin-node directly:

 ./dev_scripts/query_munin_node list

=item B<run>

To run Munin master programs (munin-update, munin-html, munin-cron,
etc) use the run command.

 ./dev_scripts/run CMD [CMD args ...]


=back


=head1 PUNCTUATION VARIABLES

Don't use punctuation variables (see Perl Best Practices page 79.)

 use English qw(-no_match_vars);

We'll add an exception for $_, and $! as they should be fairly widely
recognized.


=head1 FORMATTING

=head2 perltidy

FIX


=head1 TESTS AND COVERAGE

Use test-driven devolopment.

In node, server, or common:

 perl Build.PL
 ./Build test


=head1 EXCEPTION HANDLING

Currently there is no unified approach to handling exceptions. Use
L<Carp>?

 use Carp;
 croak("Foo happened!");

 confess("Foo happened!"); # With stack trace

Exceptions are caught with an eval:

 eval {
     # Exceptionally scary code
 };
 if ($EVAL_ERROR) {
     # Handle exception
 }



=head1 DOCUMENTATION

The API documentation is embedded as POD in the code.  See L<perlpod>
for more on POD.

More is on L<http://munin-monitoring.org/wiki/Documentation>

=head2 WRITING

The POD should be defined all in one place. For plugins you place it at
the top, else at the bottom.

=cut