prometheus-client-mmap 0.7.0.beta41 → 0.7.0.beta42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/fast_mmaped_file/extconf.rb +15 -0
- data/ext/fast_mmaped_file/fast_mmaped_file.c +49 -24
- data/ext/fast_mmaped_file/file_parsing.c +84 -109
- data/ext/fast_mmaped_file/file_parsing.h +7 -6
- data/ext/fast_mmaped_file/file_reading.c +41 -32
- data/ext/fast_mmaped_file/file_reading.h +1 -1
- data/ext/fast_mmaped_file/globals.h +3 -0
- data/ext/fast_mmaped_file/hashmap.c +409 -466
- data/ext/fast_mmaped_file/jsmn.c +259 -243
- data/ext/fast_mmaped_file/mmap.c +332 -0
- data/ext/fast_mmaped_file/mmap.h +9 -0
- data/ext/fast_mmaped_file/rendering.c +110 -37
- data/ext/fast_mmaped_file/rendering.h +2 -2
- data/ext/fast_mmaped_file/utils.c +3 -2
- data/ext/fast_mmaped_file/utils.h +1 -1
- data/ext/fast_mmaped_file/value_access.c +88 -48
- data/ext/fast_mmaped_file/value_access.h +4 -2
- data/lib/fast_mmaped_file.bundle +0 -0
- data/lib/prometheus/client/helper/entry_parser.rb +1 -1
- data/lib/prometheus/client/helper/mmaped_file.rb +4 -6
- data/lib/prometheus/client/helper/plain_file.rb +3 -3
- data/lib/prometheus/client/mmaped_dict.rb +2 -7
- data/lib/prometheus/client/simple_value.rb +0 -1
- data/lib/prometheus/client/support/unicorn.rb +9 -0
- data/lib/prometheus/client/version.rb +1 -1
- metadata +3 -25
- data/ext/fast_mmaped_file/hashmap.h +0 -266
- data/ext/fast_mmaped_file/jsmn.h +0 -76
- data/lib/prometheus/client/version.rb.orig +0 -9
data/ext/fast_mmaped_file/jsmn.h
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
#ifndef __JSMN_H_
|
2
|
-
#define __JSMN_H_
|
3
|
-
|
4
|
-
#include <stddef.h>
|
5
|
-
|
6
|
-
#ifdef __cplusplus
|
7
|
-
extern "C" {
|
8
|
-
#endif
|
9
|
-
|
10
|
-
/**
|
11
|
-
* JSON type identifier. Basic types are:
|
12
|
-
* o Object
|
13
|
-
* o Array
|
14
|
-
* o String
|
15
|
-
* o Other primitive: number, boolean (true/false) or null
|
16
|
-
*/
|
17
|
-
typedef enum {
|
18
|
-
JSMN_UNDEFINED = 0,
|
19
|
-
JSMN_OBJECT = 1,
|
20
|
-
JSMN_ARRAY = 2,
|
21
|
-
JSMN_STRING = 3,
|
22
|
-
JSMN_PRIMITIVE = 4
|
23
|
-
} jsmntype_t;
|
24
|
-
|
25
|
-
enum jsmnerr {
|
26
|
-
/* Not enough tokens were provided */
|
27
|
-
JSMN_ERROR_NOMEM = -1,
|
28
|
-
/* Invalid character inside JSON string */
|
29
|
-
JSMN_ERROR_INVAL = -2,
|
30
|
-
/* The string is not a full JSON packet, more bytes expected */
|
31
|
-
JSMN_ERROR_PART = -3
|
32
|
-
};
|
33
|
-
|
34
|
-
/**
|
35
|
-
* JSON token description.
|
36
|
-
* type type (object, array, string etc.)
|
37
|
-
* start start position in JSON data string
|
38
|
-
* end end position in JSON data string
|
39
|
-
*/
|
40
|
-
typedef struct {
|
41
|
-
jsmntype_t type;
|
42
|
-
int start;
|
43
|
-
int end;
|
44
|
-
int size;
|
45
|
-
#ifdef JSMN_PARENT_LINKS
|
46
|
-
int parent;
|
47
|
-
#endif
|
48
|
-
} jsmntok_t;
|
49
|
-
|
50
|
-
/**
|
51
|
-
* JSON parser. Contains an array of token blocks available. Also stores
|
52
|
-
* the string being parsed now and current position in that string
|
53
|
-
*/
|
54
|
-
typedef struct {
|
55
|
-
unsigned int pos; /* offset in the JSON string */
|
56
|
-
unsigned int toknext; /* next token to allocate */
|
57
|
-
int toksuper; /* superior token node, e.g parent object or array */
|
58
|
-
} jsmn_parser;
|
59
|
-
|
60
|
-
/**
|
61
|
-
* Create JSON parser over an array of tokens
|
62
|
-
*/
|
63
|
-
void jsmn_init(jsmn_parser *parser);
|
64
|
-
|
65
|
-
/**
|
66
|
-
* Run JSON parser. It parses a JSON data string into and array of tokens, each describing
|
67
|
-
* a single JSON object.
|
68
|
-
*/
|
69
|
-
int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
|
70
|
-
jsmntok_t *tokens, unsigned int num_tokens);
|
71
|
-
|
72
|
-
#ifdef __cplusplus
|
73
|
-
}
|
74
|
-
#endif
|
75
|
-
|
76
|
-
#endif /* __JSMN_H_ */
|