source: branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRenderServer.h @ 3313

Last change on this file since 3313 was 3313, checked in by ldelgass, 12 years ago

vtkvis: write stats on data sets loaded. Should probably write a separate entry
before each data set is loaded and flush, so stats can be recorded before an
OOM situation.

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#ifndef __RAPPTURE_VTKVIS_RENDERSERVER_H__
9#define __RAPPTURE_VTKVIS_RENDERSERVER_H__
10
11#include <sys/types.h>
12#include <sys/time.h>
13
14namespace Rappture {
15namespace VtkVis {
16
17class Renderer;
18
19#define MSECS_ELAPSED(t1, t2) \
20    ((t1).tv_sec == (t2).tv_sec ? (((t2).tv_usec - (t1).tv_usec)/1.0e+3) : \
21     (((t2).tv_sec - (t1).tv_sec))*1.0e+3 + (double)((t2).tv_usec - (t1).tv_usec)/1.0e+3)
22
23#define CVT2SECS(x)  ((double)(x).tv_sec) + ((double)(x).tv_usec * 1.0e-6)
24
25#define STATSDIR        "/var/tmp/visservers"
26#define STATSFILE       STATSDIR "/" "vtkvis_log.tcl"
27#define LOCKFILE        STATSDIR "/" "LCK..vtkvis"
28
29typedef struct {
30    pid_t pid;
31    size_t nDataSets;       /**< # of data sets received */
32    size_t nDataBytes;      /**< # of bytes received as data sets */
33    size_t nFrames;         /**< # of frames sent to client. */
34    size_t nFrameBytes;     /**< # of bytes for all frames. */
35    size_t nCommands;       /**< # of commands executed */
36    double cmdTime;         /**< Elasped time spend executing commands. */
37    struct timeval start;   /**< Start of elapsed time. */
38} Stats;
39
40extern Stats g_stats;
41
42extern int g_fdIn;
43extern int g_fdOut;
44extern FILE *g_fOut;
45extern FILE *g_fLog;
46extern Renderer *g_renderer;
47extern ReadBuffer *g_inBufPtr;
48
49extern int writeToStatsFile(const char *s, size_t length);
50
51}
52}
53
54#endif
Note: See TracBrowser for help on using the repository browser.