Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
1d64f14c
Commit
1d64f14c
authored
Dec 10, 2013
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
По аналогии с другими процессами (MySQL,SQLite) переименовал
RRDStorage --> RRDServer
parent
d7e1d336
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
77 deletions
+86
-77
configure.ac
configure.ac
+2
-2
Makefile.am
extensions/Makefile.am
+1
-1
Makefile.am
extensions/RRDServer/Makefile.am
+11
-11
RRDServer.cc
extensions/RRDServer/RRDServer.cc
+39
-39
RRDServer.h
extensions/RRDServer/RRDServer.h
+25
-16
create_links.sh
extensions/RRDServer/create_links.sh
+0
-0
libUniSetRRDServer.pc.in
extensions/RRDServer/libUniSetRRDServer.pc.in
+3
-3
main.cc
extensions/RRDServer/main.cc
+5
-5
start_fg.sh
extensions/RRDServer/start_fg.sh
+0
-0
No files found.
configure.ac
View file @
1d64f14c
...
...
@@ -262,8 +262,8 @@ AC_CONFIG_FILES([Makefile
extensions/SharedMemory/Makefile
extensions/SharedMemory/libUniSetSharedMemory.pc
extensions/SharedMemoryPlus/Makefile
extensions/RRDS
torage
/Makefile
extensions/RRDS
torage/libUniSetRRDStorage
.pc
extensions/RRDS
erver
/Makefile
extensions/RRDS
erver/libUniSetRRDServer
.pc
extensions/tests/Makefile
python/lib/Makefile
python/lib/pyUniSet/Makefile
...
...
extensions/Makefile.am
View file @
1d64f14c
...
...
@@ -5,7 +5,7 @@
if
HAVE_EXTENTIONS
SUBDIRS
=
lib include SharedMemory IOControl LogicProcessor
\
ModbusMaster ModbusSlave SMViewer UniNetwork UNetUDP DBServer-MySQL DBServer-SQLite
\
RRDS
torage
SharedMemoryPlus tests
RRDS
erver
SharedMemoryPlus tests
#SMDBServer
#SharedMemoryPlus
#UDPExchange
...
...
extensions/RRDS
torage
/Makefile.am
→
extensions/RRDS
erver
/Makefile.am
View file @
1d64f14c
bin_PROGRAMS
=
@PACKAGE@-rrds
torage
bin_PROGRAMS
=
@PACKAGE@-rrds
erver
RRD_VER
=
@LIBVER@
lib_LTLIBRARIES
=
libUniSetRRDS
torage
.la
libUniSetRRDS
torage
_la_LDFLAGS
=
-version-info
$(RRD_VER)
libUniSetRRDS
torage
_la_LIBADD
=
$(top_builddir)
/lib/libUniSet.la
\
lib_LTLIBRARIES
=
libUniSetRRDS
erver
.la
libUniSetRRDS
erver
_la_LDFLAGS
=
-version-info
$(RRD_VER)
libUniSetRRDS
erver
_la_LIBADD
=
$(top_builddir)
/lib/libUniSet.la
\
$(top_builddir)
/extensions/SharedMemory/libUniSetSharedMemory.la
\
$(top_builddir)
/extensions/lib/libUniSetExtensions.la
\
$(SIGC_LIBS)
$(RRD_LIBS)
libUniSetRRDS
torage
_la_CXXFLAGS
=
-I
$(top_builddir)
/extensions/include
\
libUniSetRRDS
erver
_la_CXXFLAGS
=
-I
$(top_builddir)
/extensions/include
\
-I
$(top_builddir)
/extensions/SharedMemory
\
$(SIGC_CFLAGS)
$(RRD_CFLAGS)
libUniSetRRDS
torage_la_SOURCES
=
RRDStorage
.cc
libUniSetRRDS
erver_la_SOURCES
=
RRDServer
.cc
@PACKAGE@
_rrds
torage
_SOURCES
=
main.cc
@PACKAGE@
_rrds
torage_LDADD
=
libUniSetRRDStorage
.la
$(top_builddir)
/lib/libUniSet.la
\
@PACKAGE@
_rrds
erver
_SOURCES
=
main.cc
@PACKAGE@
_rrds
erver_LDADD
=
libUniSetRRDServer
.la
$(top_builddir)
/lib/libUniSet.la
\
$(top_builddir)
/extensions/SharedMemory/libUniSetSharedMemory.la
\
$(top_builddir)
/extensions/lib/libUniSetExtensions.la
\
$(SIGC_LIBS)
$(RRD_LIBS)
@PACKAGE@
_rrds
torage
_CXXFLAGS
=
-I
$(top_builddir)
/extensions/include
\
@PACKAGE@
_rrds
erver
_CXXFLAGS
=
-I
$(top_builddir)
/extensions/include
\
-I
$(top_builddir)
/extensions/SharedMemory
\
$(SIGC_CFLAGS)
$(RRD_CFLAGS)
...
...
@@ -27,7 +27,7 @@ devel_include_HEADERS = *.h
devel_includedir
=
$(pkgincludedir)
/extensions
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfig_DATA
=
libUniSetRRDS
torage
.pc
pkgconfig_DATA
=
libUniSetRRDS
erver
.pc
all-local
:
ln
-sf
../RRDS
torage
/
$(devel_include_HEADERS)
../include
ln
-sf
../RRDS
erver
/
$(devel_include_HEADERS)
../include
extensions/RRDS
torage/RRDStorage
.cc
→
extensions/RRDS
erver/RRDServer
.cc
View file @
1d64f14c
This diff is collapsed.
Click to expand it.
extensions/RRDS
torage/RRDStorage
.h
→
extensions/RRDS
erver/RRDServer
.h
View file @
1d64f14c
#ifndef _RRDS
torage
_H_
#define _RRDS
torage
_H_
#ifndef _RRDS
erver
_H_
#define _RRDS
erver
_H_
// -----------------------------------------------------------------------------
#include "UObject_SK.h"
#include "SMInterface.h"
...
...
@@ -7,13 +7,22 @@
#include "extensions/Extensions.h"
// -----------------------------------------------------------------------------
/*!
\page page_RRDServer Реализация RRD хранилища
- \ref sec_RRD_Comm
- \ref sec_RRD_Conf
\section sec_RRD_Comm Общее описание RRDServer
"RoundRobinDatabase" - реализация циклического хранилища.
Процесс реализует циклическое хранение данных (от датчиков) и позволяет
конфигурировать любое количество rrd-баз и входящих в них "источников".
\section sec_RRD_Conf Настройка RRDServer
Пример секции конфигурации:
\code
<RRDS
torage1 name="RRDStorage
1">
<RRDS
erver1 name="RRDServer
1">
<rrd filename="rrdtest.rrd" filter_field="rrd" filter_value="1" step="5" ds_field="rrd1_ds" overwrite="0">
<item rra="RRA:AVERAGE:0.5:1:4320"/>
<item rra="RRA:MAX:0.5:1:4320"/>
...
...
@@ -22,16 +31,16 @@
<item rra="RRA:AVERAGE:0.5:1:4320"/>
<item rra="RRA:MAX:0.5:1:4320"/>
</rrd>
</RRDS
torage
1>
</RRDS
erver
1>
\endcode
Где:
\b filename - имя создаваемого rrd-файла
\b filter_field - поле у датчика, определяющее, что его нужно сохранять в БД
\b filter_value - значение
filter_field, определяющее, что датчик нужно сохранять в БД
\b ds_field - поле определяющее, параметр задающий формат хранения. Если \a ds_field не задано,
-
\b filename - имя создаваемого rrd-файла
-
\b filter_field - поле у датчика, определяющее, что его нужно сохранять в БД
- \b filter_value - значение \b
filter_field, определяющее, что датчик нужно сохранять в БД
-
\b ds_field - поле определяющее, параметр задающий формат хранения. Если \a ds_field не задано,
то будет браться filter_field+filter_value+'_ds'.
\b step - период обновления данных (в секундах)
\b overwrite - [0,1]. Пересоздавать ли БД, если файл уже существует.
-
\b step - период обновления данных (в секундах)
-
\b overwrite - [0,1]. Пересоздавать ли БД, если файл уже существует.
При этом в секции <sensors> у датчиков прописываются параметры относящиеся к источнику:
\code
...
...
@@ -45,16 +54,16 @@
</sensors>
\endcode
*/
class
RRDS
torage
:
class
RRDS
erver
:
public
UObject_SK
{
public
:
RRDS
torage
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmID
,
SharedMemory
*
ic
=
0
,
RRDS
erver
(
UniSetTypes
::
ObjectId
objId
,
xmlNode
*
cnode
,
UniSetTypes
::
ObjectId
shmID
,
SharedMemory
*
ic
=
0
,
const
std
::
string
prefix
=
"rrd"
,
DebugStream
&
log
=
UniSetExtensions
::
dlog
);
virtual
~
RRDS
torage
();
virtual
~
RRDS
erver
();
/*! глобальная функция для инициализации объекта */
static
RRDS
torage
*
init_rrdstorage
(
int
argc
,
const
char
*
const
*
argv
,
static
RRDS
erver
*
init_rrdstorage
(
int
argc
,
const
char
*
const
*
argv
,
UniSetTypes
::
ObjectId
shmID
,
SharedMemory
*
ic
=
0
,
const
std
::
string
prefix
=
"rrd"
);
...
...
@@ -62,7 +71,7 @@ class RRDStorage:
static
void
help_print
(
int
argc
,
const
char
*
const
*
argv
);
protected
:
RRDS
torage
();
RRDS
erver
();
virtual
void
askSensors
(
UniversalIO
::
UIOCommand
cmd
);
virtual
void
sensorInfo
(
UniSetTypes
::
SensorMessage
*
sm
);
...
...
@@ -105,5 +114,5 @@ class RRDStorage:
std
::
string
prefix
;
};
// -----------------------------------------------------------------------------
#endif // _RRDS
torage
_H_
#endif // _RRDS
erver
_H_
// -----------------------------------------------------------------------------
extensions/RRDS
torage
/create_links.sh
→
extensions/RRDS
erver
/create_links.sh
View file @
1d64f14c
File moved
extensions/RRDS
torage/libUniSetRRDStorage
.pc.in
→
extensions/RRDS
erver/libUniSetRRDServer
.pc.in
View file @
1d64f14c
...
...
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libUniSetRRDS
torage
Description: Support library for UniSetRRDS
torage
Name: libUniSetRRDS
erver
Description: Support library for UniSetRRDS
erver
Requires: libUniSetExtensions librrd
Version: @VERSION@
Libs: -L${libdir} -lUniSetRRDS
torage
Libs: -L${libdir} -lUniSetRRDS
erver
Cflags: -I${includedir}/uniset
extensions/RRDS
torage
/main.cc
→
extensions/RRDS
erver
/main.cc
View file @
1d64f14c
#include <sstream>
#include "RRDS
torage
.h"
#include "RRDS
erver
.h"
#include "Configuration.h"
#include "Debug.h"
#include "ObjectsActivator.h"
...
...
@@ -17,7 +17,7 @@ int main( int argc, const char** argv )
cout
<<
"--confile filename - configuration file. Default: configure.xml"
<<
endl
;
cout
<<
"--rrdstorage-logfile filename - logfilename. Default: rrdstorage.log"
<<
endl
;
cout
<<
endl
;
RRDS
torage
::
help_print
(
argc
,
argv
);
RRDS
erver
::
help_print
(
argc
,
argv
);
return
0
;
}
...
...
@@ -51,7 +51,7 @@ int main( int argc, const char** argv )
return
1
;
}
RRDS
torage
*
db
=
RRDStorage
::
init_rrdstorage
(
argc
,
argv
,
shmID
);
RRDS
erver
*
db
=
RRDServer
::
init_rrdstorage
(
argc
,
argv
,
shmID
);
if
(
!
db
)
{
dlog
[
Debug
::
CRIT
]
<<
"(rrdstorage): init не прошёл..."
<<
endl
;
...
...
@@ -65,9 +65,9 @@ int main( int argc, const char** argv )
act
.
broadcast
(
sm
.
transport_msg
()
);
unideb
(
Debug
::
ANY
)
<<
"
\n\n\n
"
;
unideb
[
Debug
::
ANY
]
<<
"(main): -------------- RRDS
torage
START -------------------------
\n\n
"
;
unideb
[
Debug
::
ANY
]
<<
"(main): -------------- RRDS
erver
START -------------------------
\n\n
"
;
dlog
(
Debug
::
ANY
)
<<
"
\n\n\n
"
;
dlog
[
Debug
::
ANY
]
<<
"(main): -------------- RRDS
torage
START -------------------------
\n\n
"
;
dlog
[
Debug
::
ANY
]
<<
"(main): -------------- RRDS
erver
START -------------------------
\n\n
"
;
act
.
run
(
false
);
return
0
;
}
...
...
extensions/RRDS
torage
/start_fg.sh
→
extensions/RRDS
erver
/start_fg.sh
View file @
1d64f14c
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment