cpee-model-management 1.2.2 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee-model-management.gemspec +1 -1
- data/lib/cpee-model-management/implementation.rb +21 -13
- data/server/testset.xml +6 -2
- data/ui/index.html +1 -1
- data/ui/instances.html +1 -2
- data/ui/instances_view.html +1 -2
- data/ui/js/stats.js +10 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a1bebe35489c61c12ce579cf533eed01d4471bd81dfe35f1f8ec9229ab9991
|
4
|
+
data.tar.gz: 99e78da9cb6fc8f9487c6753eef04adbf4359ba72a12979c546120c19c91df56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41da660e08a891990154eff23942d4df183edb36142417a90067821d9554e7e83bfbcc493ca1e533664f43e49179fd8ea4c1c504782f16e8497c4b95c354bb48
|
7
|
+
data.tar.gz: c410854184e37eb40cf4bc0fed672f244a9015a1385b4329015358d977c7653ee260b746997442b5b79453d91dbb8a05ffb468eb451ef23710fe6de8da274402
|
@@ -724,10 +724,13 @@ module CPEE
|
|
724
724
|
multi.set(File.join(prefix,'name'),attr['info'])
|
725
725
|
multi.set(File.join(prefix,'cpu'),0)
|
726
726
|
multi.set(File.join(prefix,'mem'),0)
|
727
|
-
multi.set(File.join(prefix,'time'),
|
727
|
+
multi.set(File.join(prefix,'time'),Time.now.to_i)
|
728
728
|
end
|
729
729
|
elsif %w{stopping}.include?(content['state'])
|
730
|
-
redis.
|
730
|
+
redis.multi do |multi|
|
731
|
+
multi.set(File.join(prefix,'state'),content['state'])
|
732
|
+
multi.set(File.join(prefix,'time'),Time.now.to_i)
|
733
|
+
end
|
731
734
|
elsif %w{stopped}.include?(content['state'])
|
732
735
|
redis.multi do |multi|
|
733
736
|
multi.decr(File.join(engine,'running'))
|
@@ -735,7 +738,7 @@ module CPEE
|
|
735
738
|
multi.set(File.join(prefix,'state'),content['state'])
|
736
739
|
multi.set(File.join(prefix,'cpu'),0)
|
737
740
|
multi.set(File.join(prefix,'mem'),0)
|
738
|
-
multi.set(File.join(prefix,'time'),
|
741
|
+
multi.set(File.join(prefix,'time'),Time.now.to_i)
|
739
742
|
end
|
740
743
|
elsif %w{running}.include?(content['state'])
|
741
744
|
oldstate = redis.get(File.join(prefix,'state'))
|
@@ -748,16 +751,17 @@ module CPEE
|
|
748
751
|
end
|
749
752
|
end
|
750
753
|
|
751
|
-
url, author, path, name, state, parent = redis.mget(
|
754
|
+
url, author, path, name, state, time, parent = redis.mget(
|
752
755
|
File.join(prefix,'instance-url'),
|
753
756
|
File.join(prefix,'author'),
|
754
757
|
File.join(prefix,'path'),
|
755
758
|
File.join(prefix,'name'),
|
756
759
|
File.join(prefix,'state'),
|
760
|
+
File.join(prefix,'time'),
|
757
761
|
File.join(prefix,'parent')
|
758
762
|
)
|
759
763
|
receivers.each do |conn|
|
760
|
-
conn.send JSON::generate(:topic => topic, :event => event_name, :engine => engine, :uuid => notification['instance-uuid'], :url => url, :author => author, :path => path.to_s, :name => name, :state => content['state'], :parent => parent.to_s)
|
764
|
+
conn.send JSON::generate(:topic => topic, :event => event_name, :engine => engine, :uuid => notification['instance-uuid'], :url => url, :author => author, :path => path.to_s, :name => name, :state => content['state'], :time => time, :parent => parent.to_s)
|
761
765
|
end
|
762
766
|
elsif topic == 'task' && event_name == 'instantiation'
|
763
767
|
redis.multi do |multi|
|
@@ -765,16 +769,17 @@ module CPEE
|
|
765
769
|
multi.set(File.join(engine,content['received']['CPEE-INSTANCE-UUID'],'parent'),notification['instance-uuid'])
|
766
770
|
end
|
767
771
|
prefix = File.join(engine,content['received']['CPEE-INSTANCE-UUID'].to_s)
|
768
|
-
url, author, path, name, state, parent = redis.mget(
|
772
|
+
url, author, path, name, state, time, parent = redis.mget(
|
769
773
|
File.join(prefix,'instance-url'),
|
770
774
|
File.join(prefix,'author'),
|
771
775
|
File.join(prefix,'path'),
|
772
776
|
File.join(prefix,'name'),
|
773
777
|
File.join(prefix,'state'),
|
778
|
+
File.join(prefix,'time'),
|
774
779
|
File.join(prefix,'parent')
|
775
780
|
)
|
776
781
|
receivers.each do |conn|
|
777
|
-
conn.send JSON::generate(:topic => 'state', :event => 'change', :engine => engine, :uuid => content['received']['CPEE-INSTANCE-UUID'], :url => url, :author => author, :path => path.to_s, :name => name, :state => state, :parent => parent.to_s)
|
782
|
+
conn.send JSON::generate(:topic => 'state', :event => 'change', :engine => engine, :uuid => content['received']['CPEE-INSTANCE-UUID'], :url => url, :author => author, :path => path.to_s, :name => name, :state => state, :time => time, :parent => parent.to_s)
|
778
783
|
end
|
779
784
|
elsif topic == 'status' && event_name == 'resource_utilization'
|
780
785
|
redis.multi do |multi|
|
@@ -821,7 +826,7 @@ module CPEE
|
|
821
826
|
doc = XML::Smart.string('<instances/>')
|
822
827
|
redis.lrange(File.join(engine,'instances'),0,-1).each do |i|
|
823
828
|
prefix = File.join(engine,i.to_s)
|
824
|
-
url, author, path, name, state, cpu, mem, parent = redis.mget(
|
829
|
+
url, author, path, name, state, cpu, mem, parent,time = redis.mget(
|
825
830
|
File.join(prefix,'instance-url'),
|
826
831
|
File.join(prefix,'author'),
|
827
832
|
File.join(prefix,'path'),
|
@@ -829,9 +834,10 @@ module CPEE
|
|
829
834
|
File.join(prefix,'state'),
|
830
835
|
File.join(prefix,'cpu'),
|
831
836
|
File.join(prefix,'mem'),
|
832
|
-
File.join(prefix,'parent')
|
837
|
+
File.join(prefix,'parent'),
|
838
|
+
File.join(prefix,'time')
|
833
839
|
)
|
834
|
-
doc.root.add('instance', :uuid => i, :url => url, :author => author, :path => path, :name => name, :state => state, :cpu => cpu, :mem => mem, :parent => parent)
|
840
|
+
doc.root.add('instance', :uuid => i, :url => url, :author => author, :path => path, :name => name, :state => state, :cpu => cpu, :mem => mem, :parent => parent, :time => time)
|
835
841
|
end
|
836
842
|
Riddl::Parameter::Complex.new('tree','text/xml',doc.to_s)
|
837
843
|
end
|
@@ -842,7 +848,7 @@ module CPEE
|
|
842
848
|
engine = @p[0].value
|
843
849
|
uuid = @r[-1]
|
844
850
|
prefix = File.join(engine,uuid.to_s)
|
845
|
-
url, author, path, name, state, cpu, mem, parent = redis.mget(
|
851
|
+
url, author, path, name, state, cpu, mem, parent, time = redis.mget(
|
846
852
|
File.join(prefix,'instance-url'),
|
847
853
|
File.join(prefix,'author'),
|
848
854
|
File.join(prefix,'path'),
|
@@ -850,9 +856,11 @@ module CPEE
|
|
850
856
|
File.join(prefix,'state'),
|
851
857
|
File.join(prefix,'cpu'),
|
852
858
|
File.join(prefix,'mem'),
|
853
|
-
File.join(prefix,'parent')
|
859
|
+
File.join(prefix,'parent'),
|
860
|
+
File.join(prefix,'time')
|
861
|
+
|
854
862
|
)
|
855
|
-
Riddl::Parameter::Complex.new('instance','application/json',JSON.generate(:uuid => uuid, :url => url, :author => author, :path => path, :name => name, :state => state, :cpu => cpu, :mem => mem, :parent => parent))
|
863
|
+
Riddl::Parameter::Complex.new('instance','application/json',JSON.generate(:uuid => uuid, :url => url, :author => author, :path => path, :name => name, :state => state, :cpu => cpu, :mem => mem, :parent => parent, :time => time))
|
856
864
|
end
|
857
865
|
end #}}}
|
858
866
|
|
data/server/testset.xml
CHANGED
@@ -2,8 +2,12 @@
|
|
2
2
|
<dataelements/>
|
3
3
|
<executionhandler>ruby</executionhandler>
|
4
4
|
<endpoints>
|
5
|
-
<
|
6
|
-
<
|
5
|
+
<user>https-post://cpee.org/services/timeout-user.php</user>
|
6
|
+
<auto>https-post://cpee.org/services/timeout-auto.php</auto>
|
7
|
+
<timeout>https-post://cpee.org/services/timeout.php</timeout>
|
8
|
+
<subprocess>https-post://cpee.org/flow/start/url/</subprocess>
|
9
|
+
<send>https-post://cpee.org/ing/correlators/message/send/</send>
|
10
|
+
<receive>https-get://cpee.org/ing/correlators/message/receive/</receive>
|
7
11
|
</endpoints>
|
8
12
|
<description>
|
9
13
|
<description xmlns="http://cpee.org/ns/description/1.0"/>
|
data/ui/index.html
CHANGED
@@ -167,7 +167,7 @@
|
|
167
167
|
<td class="state"><span class='value'></span> <span class='abandon'>[<a href='#' title='abandon'>a</a>]</span></td>
|
168
168
|
<td class="author"><em>unknown</em></td>
|
169
169
|
<td class="mem"></em></td>
|
170
|
-
<td class="
|
170
|
+
<td class="time"></em></td>
|
171
171
|
</tr>
|
172
172
|
<tr class="sub">
|
173
173
|
<td colspan="6"><table></table></td>
|
data/ui/instances.html
CHANGED
@@ -77,9 +77,8 @@
|
|
77
77
|
<td class="num">(<span></span>)</td>
|
78
78
|
<td class="state"><span class='value'></span> <span class='abandon'>[<a href='#' title='abandon'>a</a>]</span></td>
|
79
79
|
<td class="author"><em>unknown</em></td>
|
80
|
-
<td class="cpu"></td>
|
81
|
-
<td>/</td>
|
82
80
|
<td class="mem"></em></td>
|
81
|
+
<td class="time"></em></td>
|
83
82
|
</tr>
|
84
83
|
<tr class="sub">
|
85
84
|
<td colspan="6"><table></table></td>
|
data/ui/instances_view.html
CHANGED
@@ -77,9 +77,8 @@
|
|
77
77
|
<td class="num">(<span></span>)</td>
|
78
78
|
<td class="state"><span class='value'></span></td>
|
79
79
|
<td class="author"><em>unknown</em></td>
|
80
|
-
<td class="cpu"></td>
|
81
|
-
<td>/</td>
|
82
80
|
<td class="mem"></em></td>
|
81
|
+
<td class="time"></em></td>
|
83
82
|
</tr>
|
84
83
|
<tr class="sub">
|
85
84
|
<td colspan="6"><table></table></td>
|
data/ui/js/stats.js
CHANGED
@@ -61,12 +61,12 @@ function instance_change(d) {
|
|
61
61
|
if ($('[data-id=' + d.uuid + ']').length > 0) {
|
62
62
|
if ($('[data-id=' + d.uuid + ']').attr('data-parent') != parent) {
|
63
63
|
$('[data-id=' + d.uuid + ']').remove()
|
64
|
-
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.parent)
|
64
|
+
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.time,d.parent)
|
65
65
|
} else {
|
66
|
-
instance_upd(d.uuid,d.name,d.state,d.author,0,0,d.parent)
|
66
|
+
instance_upd(d.uuid,d.name,d.state,d.author,0,0,d.time,d.parent)
|
67
67
|
}
|
68
68
|
} else {
|
69
|
-
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.parent)
|
69
|
+
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.time,d.parent)
|
70
70
|
}
|
71
71
|
} else if (d.state == 'abandoned' || d.state == 'finished') {
|
72
72
|
if ($('tr.sub[data-id=' + d.uuid + '] > td > table > tr').length > 0) {
|
@@ -77,14 +77,14 @@ function instance_change(d) {
|
|
77
77
|
} else {
|
78
78
|
if ($('tr.sub[data-id=' + d.uuid + ']').attr('data-parent') != d.parent) {
|
79
79
|
$('[data-id=' + d.uuid + ']').remove()
|
80
|
-
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.parent)
|
80
|
+
instance_add(iname,d.uuid,d.url,d.name,d.state,d.author,0,0,d.time,d.parent)
|
81
81
|
} else {
|
82
|
-
instance_upd(d.uuid,d.name,d.state,d.author,0,0,d.parent)
|
82
|
+
instance_upd(d.uuid,d.name,d.state,d.author,0,0,d.time,d.parent)
|
83
83
|
}
|
84
84
|
}
|
85
85
|
}
|
86
86
|
|
87
|
-
function instance_upd(uuid,name,state,author,cpu,mem,parent) {
|
87
|
+
function instance_upd(uuid,name,state,author,cpu,mem,time,parent) {
|
88
88
|
if (name != "") {
|
89
89
|
$('[data-id=' + uuid + '] > .name a').text(name)
|
90
90
|
$('[data-id=' + uuid + '] > .name a').attr('title',name)
|
@@ -94,13 +94,14 @@ function instance_upd(uuid,name,state,author,cpu,mem,parent) {
|
|
94
94
|
if (author != "") {
|
95
95
|
$('[data-id=' + uuid + '] > .author').text(author)
|
96
96
|
}
|
97
|
+
$('[data-id=' + uuid + '] > .time').text((new Date(time * 1000)).strftime("%H:%M:%S (%b-%d)"))
|
97
98
|
instance_res(uuid,cpu,mem)
|
98
99
|
}
|
99
100
|
function instance_res(uuid,cpu,mem) {
|
100
101
|
$('[data-id=' + uuid + '] > .cpu').text($.sprintf('%05.2f',cpu))
|
101
102
|
$('[data-id=' + uuid + '] > .mem').text($.sprintf('%05.2f',mem))
|
102
103
|
}
|
103
|
-
function instance_add(iname,uuid,url,name,state,author,cpu,mem,parent) {
|
104
|
+
function instance_add(iname,uuid,url,name,state,author,cpu,mem,time,parent) {
|
104
105
|
let inode = document.importNode($("#stats_instance")[0].content,true);
|
105
106
|
$('.sub',inode).attr('id',uuid)
|
106
107
|
$('.sub',inode).attr('data-id',uuid)
|
@@ -120,6 +121,7 @@ function instance_add(iname,uuid,url,name,state,author,cpu,mem,parent) {
|
|
120
121
|
}
|
121
122
|
$('.cpu',inode).text($.sprintf('%05.2f',cpu))
|
122
123
|
$('.mem',inode).text($.sprintf('%05.2f',mem))
|
124
|
+
$('.time',inode).text((new Date(time * 1000)).strftime("%H:%M:%S (%b-%d)"))
|
123
125
|
if (parent == "") {
|
124
126
|
$('#instances_' + iname).append(inode)
|
125
127
|
} else {
|
@@ -154,7 +156,7 @@ function instances_init(ename) {
|
|
154
156
|
success: (result) => {
|
155
157
|
$('instance',result).each(async (i,ele)=>{
|
156
158
|
const e = $(ele);
|
157
|
-
setTimeout(()=>{instance_add(iname,e.attr('uuid'),e.attr('url'),e.attr('name'),e.attr('state'),e.attr('author'),e.attr('cpu'),e.attr('mem'),e.attr('parent'))},0)
|
159
|
+
setTimeout(()=>{instance_add(iname,e.attr('uuid'),e.attr('url'),e.attr('name'),e.attr('state'),e.attr('author'),e.attr('cpu'),e.attr('mem'),e.attr('time'),e.attr('parent'))},0)
|
158
160
|
})
|
159
161
|
}
|
160
162
|
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-model-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: tools
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riddl
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.5.9
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: "(Lifecycle) manage your process models in a directory or git repo."
|