aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui-stats.h
blob: f0761baec1d5ade260ac326c34e5575bda3740e8 (plain)
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
#ifndef UI_STATS_H
#define UI_STATS_H

#include "cgit.h"

struct cgit_period {
	const char code;
	const char *name;
	int max_periods;
	int count;

	/* Convert a tm value to the first day in the period */
	void (*trunc)(struct tm *tm);

	/* Update tm value to start of next/previous period */
	void (*dec)(struct tm *tm);
	void (*inc)(struct tm *tm);

	/* Pretty-print a tm value */
	char *(*pretty)(struct tm *tm);
};

extern int cgit_find_stats_period(const char *expr, struct cgit_period **period);
extern const char *cgit_find_stats_periodname(int idx);

extern void cgit_show_stats(struct cgit_context *ctx);

#endif /* UI_STATS_H */
p;& cgit_url "bar/log" && cgit_url "bar/diff" && cgit_url "bar/patch" && ls cache >output && test_line_count = 1 output ' test_expect_success 'verify cache-size=1021' ' rm -f cache/* && sed -e "s/cache-size=1$/cache-size=1021/" cgitrc >cgitrc.tmp && mv -f cgitrc.tmp cgitrc && cgit_url "" && cgit_url "foo" && cgit_url "foo/refs" && cgit_url "foo/tree" && cgit_url "foo/log" && cgit_url "foo/diff" && cgit_url "foo/patch" && cgit_url "bar" && cgit_url "bar/refs" && cgit_url "bar/tree" && cgit_url "bar/log" && cgit_url "bar/diff" && cgit_url "bar/patch" && ls cache >output && test_line_count = 13 output && cgit_url "foo/ls_cache" >output.full && strip_headers <output.full >output && test_line_count = 13 output && # Check that ls_cache output is cached correctly cgit_url "foo/ls_cache" >output.second && test_cmp output.full output.second ' test_done