Lines Matching refs:line
57 const char *line;
59 line = i_stream_read_next_line(input);
60 if (line == NULL)
63 return p_strsplit_tabescaped(pool, line);
143 struct top_line *line)
150 line->cur_values[ctx->last_update_idx]) != 0) {
156 /* line hasn't been updated, keep old values */
157 line->prev_values =
160 line->prev_values[i] = p_strdup(ctx->cur_pool, values[i]);
165 struct top_line *old_line, *line;
176 i_fatal("read(%s): invalid stats line", ctx->path);
178 line = p_new(ctx->cur_pool, struct top_line, 1);
179 line->id = args[0];
180 line->flip = ctx->flip;
181 line->cur_values = p_new(ctx->cur_pool, const char *, ctx->headers_count);
183 line->cur_values[i] = args[i];
185 old_line = hash_table_lookup(ctx->sessions, line->id);
187 stats_line_set_prev_values(ctx, old_line, line);
188 array_append(&ctx->lines, &line, 1);
190 hash_table_update(ctx->sessions, line->id, line);
204 struct top_line *line;
207 while (hash_table_iterate(iter, ctx->sessions, &id, &line)) {
208 if (line->flip != ctx->flip)
222 static double sort_cpu_diff(const struct top_line *line)
226 if (get_double(line->prev_values[sort_ctx->last_update_idx], &prev_time) < 0 ||
227 get_double(line->cur_values[sort_ctx->last_update_idx], &cur_time) < 0)
231 if (get_double(line->prev_values[sort_ctx->sort_idx1], &prev) < 0 ||
232 get_double(line->cur_values[sort_ctx->sort_idx1], &cur) < 0)
238 if (get_double(line->prev_values[sort_ctx->sort_idx2], &prev) < 0 ||
239 get_double(line->cur_values[sort_ctx->sort_idx2], &cur) < 0)
260 static double sort_num_diff(const struct top_line *line)
264 if (str_to_uint64(line->prev_values[sort_ctx->sort_idx1], &prev) < 0 ||
265 str_to_uint64(line->cur_values[sort_ctx->sort_idx1], &cur) < 0)
270 if (str_to_uint64(line->prev_values[sort_ctx->sort_idx2], &prev) < 0 ||
271 str_to_uint64(line->cur_values[sort_ctx->sort_idx2], &cur) < 0)
379 const struct top_line *line, unsigned int i)
385 if (str_to_uint64(line->prev_values[i], &prev_num) == 0 &&
386 str_to_uint64(line->cur_values[i], &cur_num) == 0) {
391 } else if (get_double(line->prev_values[i], &prev_double) == 0 &&
392 get_double(line->cur_values[i], &cur_double) == 0 &&
393 get_double(line->prev_values[ctx->last_update_idx], &prev_time) == 0 &&
394 get_double(line->cur_values[ctx->last_update_idx], &cur_time) == 0) {
402 doveadm_print(line->cur_values[i]);
502 const char *line;
528 line = i_stream_read_next_line(input);
530 if (line == NULL) {
532 } else if (strncmp(line, "OK", 2) != 0) {
533 i_error("%s",line);