]> git.evergreen-ils.org Git - OpenSRF.git/blob - doc/dokuwiki-doc-stubber.pl
stubber for dokuwiki -- OpenSRF
[OpenSRF.git] / doc / dokuwiki-doc-stubber.pl
1 #!/usr/bin/perl -w
2 use OpenSRF::System qw(/pines/conf/bootstrap.conf);
3 use Data::Dumper;
4
5 $| = 1;
6
7 # ----------------------------------------------------------------------------------------
8 # This is a quick and dirty script to perform benchmarking against the math server.
9 # Note: 1 request performs a batch of 4 queries, one for each supported method: add, sub,
10 # mult, div.
11 # Usage: $ perl math_bench.pl <num_requests>
12 # ----------------------------------------------------------------------------------------
13
14
15 my $count = $ARGV[0];
16
17 unless( $count ) {
18         print "usage: $0 <service name> [<cvs repo base URL>]\n";
19         exit;
20 }
21
22 my $cvs_base = $ARGV[1] || 'http://open-ils.org/cgi-bin/viewcvs.cgi/ILS/Open-ILS/src/perlmods/';
23
24 OpenSRF::System->bootstrap_client();
25 my $session = OpenSRF::AppSession->create( $ARGV[0] );
26
27 my $req = $session->request('opensrf.system.method.all');
28
29 while( my $meth = $req->recv(60) ) {
30         $meth = $meth->content;
31         my $api_name = $meth->{api_name};
32         my $api_level = int $meth->{api_level};
33         my $server_class = $meth->{server_class} || '**ALL**';
34         my $stream = int($meth->{stream} || 0);
35         my $cachable = int($meth->{cachable} || 0);
36         my $note = $meth->{note} || 'what I do';
37         my $package = $meth->{package};
38         (my $cvs = $package) =~ s/::/\//go;
39         my $method = $meth->{method};
40
41         $stream = $stream?'Yes':'No';
42         $cachable = $cachable?'Yes':'No';
43
44         print <<"       METHOD";
45 ===== $api_name =====
46
47 $note
48
49   * [[osrf-devel:terms#opensrf_api-level|API Level]]: $api_level
50   * [[osrf-devel:terms#opensrf_server_class|Server Class]]: $server_class
51   * Implementation Method: [[$cvs_base/$cvs.pm|$package\::$method]]
52   * Streaming [[osrf-devel:terms#opensrf_method|Method]]: $stream
53   * Cachable [[osrf-devel:terms#opensrf_method|Method]]: $cachable
54
55   * **Parameters:**
56     * //param1//\\\\ what it is...
57   * **Returns:**
58     * //Success//\\\\ successful format
59     * //Failure//\\\\ failure format (exception, etc)
60
61
62         METHOD
63 }
64