EventChart 2022.6.9 → 2022.6.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eventchart.js.rb +15 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2de760ff473ce903568b5b98401c7aae4c7e69c23ed582d9831813ed0fbe00a9
4
- data.tar.gz: 33e31ca108f6a478d9a1afb56bf62ab081083a39327772a6b72a45d894100952
3
+ metadata.gz: 7dfaa44bcfe12d5e1607506f0f1c3bc0693a868c926612a2ab9bdfcfac1af084
4
+ data.tar.gz: 4edb737eccf9e7d36decf023c2514fe2dca8fd9cdbc59ba0e971a5b9f2ae42cc
5
5
  SHA512:
6
- metadata.gz: 9ca1dfff55bcb0cab576c02a91e587b789fdaea6685a88e896cca6285a7612f5102b26b8b1136eb19281d451e575dcfdf4f9f926a065b0e546d03539ad3779e4
7
- data.tar.gz: a9eef3db6fe0fbaa79ad1cae99251774e342c31b5aa8214265a630a15b2f6c5acb5a09f3be47bd0ee4ce36a813cca72ad1770f8aee312155eaef5dc87a15f0c0
6
+ metadata.gz: ba326bb1aa69a26a72ee9870c0d7b5dc613b01867bf11d35539a0cced522bca6f1f7fdf3b5b067cf47d255015aa6825eb4d3d2c1e36fbe76bbba0d8d399557c3
7
+ data.tar.gz: 67058f349810fd7e879abb740448863720b64a1ff9e1150682c3fb4d2b167674b628dcff8da8d8e0e487ba800d3787a645653a79de58d3dc05e6fa38f4bd9d1b
data/lib/eventchart.js.rb CHANGED
@@ -11,6 +11,19 @@ class EventChart
11
11
  @events=[] # Event list
12
12
  end
13
13
 
14
+ # Schedule a timer to wirte evnetys.
15
+ def scheduleWriteEventTimer
16
+ time=Time.now
17
+
18
+ if (time-@lastTimerTime)>1 # 1 timer 1 second at most
19
+ @timer&.cancel # Cancel existing timer.
20
+
21
+ @timer = EventMachine::Timer.new(10) { writeEvents }
22
+
23
+ @lastTimerTime= time
24
+ end #if (time-@lastTimerTime)>1 # 1 timer 1 second at most
25
+ end
26
+
14
27
  # 解压
15
28
  def reportEvent(eventType, event)
16
29
  event['eventType']=eventType
@@ -19,9 +32,8 @@ class EventChart
19
32
 
20
33
  #EventMachine.add_timer(10) { writeEvents }
21
34
 
22
- @timer&.cancel # Cancel existing timer.
23
-
24
- @timer = EventMachine::Timer.new(10) { writeEvents }
35
+ scheduleWriteEventTimer # Schedule a timer to wirte evnetys.
36
+
25
37
  end # def exuz(rootPath)
26
38
 
27
39
  def writeEvents
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: EventChart
3
3
  version: !ruby/object:Gem::Version
4
- version: 2022.6.9
4
+ version: 2022.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hxcan Cai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-09 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cod