Project
Loading...
Searching...
No Matches
SpyService.cxx
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
#include "
SpyService.h
"
12
#include <uv.h>
13
#include "
Framework/DeviceSpec.h
"
14
#include "
Framework/DeviceState.h
"
15
#include "
Framework/ServiceRegistry.h
"
16
#include "
Framework/GuiCallbackContext.h
"
17
#include "
SpyServiceHelpers.h
"
18
19
#include <string>
20
#include <string_view>
21
22
namespace
o2::framework
23
{
24
SpyService::SpyService
(
ServiceRegistryRef
registry,
DeviceState
& deviceState)
25
: mRegistry{registry},
26
mDeviceState{deviceState}
27
{
28
renderer
=
new
GuiRenderer
;
29
}
30
31
ServiceSpec
*
SpyGUIPlugin::create
()
32
{
33
return
new
ServiceSpec
{
34
.
name
=
"spy"
,
35
.init = [](
ServiceRegistryRef
services,
DeviceState
&
state
, fair::mq::ProgOptions& options) ->
ServiceHandle
{
36
return
ServiceHandle
{TypeIdHelpers::uniqueId<SpyService>(),
new
SpyService
(services,
state
)};
37
},
38
.configure =
CommonServices::noConfiguration
(),
39
.preSendingMessages = [](
ServiceRegistryRef
registry, fair::mq::Parts& parts,
ChannelIndex
channelIndex) {
40
auto
&spy = registry.
get
<
SpyService
>();
41
spy.
parts
= &parts;
42
spy.partsAlive =
false
;
43
44
auto
loop = registry.
get
<
DeviceState
>().loop;
45
GuiRenderer
* renderer = registry.
get
<
SpyService
>().renderer;
46
47
if
(renderer->guiConnected && uv_now(loop) > spy.enableAfter) {
48
LOG
(info) <<
"Sending Policy uv_run"
;
49
registry.
get
<
SpyService
>().partsAlive =
true
;
50
uv_run(loop, UV_RUN_DEFAULT);
51
} },
52
.postRenderGUI = [](
ServiceRegistryRef
registry) {
SpyServiceHelpers::webGUI
(registry); },
53
.kind =
ServiceKind::Serial
};
54
};
55
56
}
// namespace o2::framework
state
benchmark::State & state
Definition
BenchCathodeSegmentation.cxx:58
DeviceSpec.h
DeviceState.h
GuiCallbackContext.h
ServiceRegistry.h
SpyServiceHelpers.h
SpyService.h
o2::framework::ServiceRegistryRef
Definition
ServiceRegistryRef.h:21
o2::framework::ServiceRegistryRef::get
T & get() const
Definition
ServiceRegistryRef.h:85
o2::framework::SpyServiceHelpers::webGUI
static void webGUI(ServiceRegistryRef registry)
Definition
SpyServiceHelpers.cxx:31
o2::framework::SpyService
Definition
SpyService.h:31
o2::framework::SpyService::renderer
GuiRenderer * renderer
Definition
SpyService.h:35
o2::framework::SpyService::SpyService
SpyService(ServiceRegistryRef registry, DeviceState &deviceState)
Definition
SpyService.cxx:24
o2::framework::SpyService::parts
fair::mq::Parts * parts
Definition
SpyService.h:40
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::ServiceKind::Serial
@ Serial
o2::framework::ChannelIndex
Definition
RoutingIndices.h:30
o2::framework::CommonServices::noConfiguration
static ServiceConfigureCallback noConfiguration()
Definition
CommonServices.h:54
o2::framework::DeviceState
Running state information of a given device.
Definition
DeviceState.h:34
o2::framework::GuiRenderer
Definition
GuiCallbackContext.h:28
o2::framework::ServiceHandle
Definition
ServiceHandle.h:43
o2::framework::ServiceSpec
Definition
ServiceSpec.h:138
o2::framework::ServiceSpec::name
std::string name
Name of the service.
Definition
ServiceSpec.h:140
o2::framework::SpyGUIPlugin::create
auto create() -> ServiceSpec *final
Definition
SpyService.cxx:31
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Framework
GUISupport
src
SpyService.cxx
Generated on Tue Feb 25 2025 23:16:41 for Project by
1.9.8