Skip to content

Commit 2f8f427

Browse files
committed
Enhance README and remove console stats
Updated the README with visual enhancements, including an image and section dividers for better readability. Added a new "Requirements" section. Removed redundant console statistics logging from the module, simplifying the server initialization process. This streamlining aims to enhance performance and focus on core functionality.
1 parent 8dce1a0 commit 2f8f427

File tree

4 files changed

+23
-42
lines changed

4 files changed

+23
-42
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# JoobQ
22

3+
<hr />
4+
5+
<img src="./joobq-logo.png">
6+
37
![Crystal CI](https://github.com/eliasjpr/joobq/workflows/Crystal%20CI/badge.svg?branch=master)
48

59
JoobQ is a fast, efficient asynchronous reliable job queue scheduler library
610
processing. Jobs are submitted to a job queue, where they reside until they are
711
able to be scheduled to run in a compute environment.
812

9-
#### Features:
13+
#### Features
1014

15+
<hr />
1116
- [x] Priority queues based on number of workers
1217
- [x] Reliable queue
1318
- [x] Error Handling
@@ -19,13 +24,25 @@ able to be scheduled to run in a compute environment.
1924

2025
## Help Wanted
2126

27+
<hr />
28+
2229
- \[ ] CLI to manage queues and monitor server
2330
- \[ ] Rest API: Rest api to schedule jobs
2431
- \[ ] Throttle (Rate limit)
2532
- \[ ] Approve Queue?: Jobs have to manually approved to execute
2633

34+
## Requirements
35+
36+
<hr />
37+
38+
This project uses REDIS with the TimeSeries module loaded. The Redis TimeSeries
39+
is used to monitor stats of job execution the module is free for use and easy to
40+
configure. Follow the guidelines at [redistimeseries.io](https://oss.redislabs.com/redistimeseries/)
41+
2742
## Installation
2843

44+
<hr />
45+
2946
```yaml
3047
dependencies:
3148
joobq:
@@ -38,14 +55,10 @@ Then run:
3855
shards install
3956
```
4057

41-
## Requirements
42-
43-
This project uses REDIS with the TimeSeries module loaded. The Redis TimeSeries
44-
is used to monitor stats of job execution the module is free for use and easy to
45-
configure. Follow the guidelines at [redistimeseries.io](https://oss.redislabs.com/redistimeseries/)
46-
4758
## Usage
4859

60+
<hr />
61+
4962
```crystal
5063
require "joobq"
5164
```
@@ -60,7 +73,7 @@ REDIS_PASS=somepass
6073
REDIS_TIMEOUT=0.2
6174
```
6275

63-
## Defining Queues
76+
### Defining Queues
6477

6578
Defining Queues: Queues are of type `Hash(String, Queue(T))` where the name of
6679
the key matches the name of the Queue.
@@ -87,7 +100,7 @@ JoobQ.configure do
87100
end
88101
```
89102

90-
## Jobs
103+
### Jobs
91104

92105
To define Jobs, must include the JoobQ::Job module, and must implement perform method
93106

@@ -127,7 +140,7 @@ end
127140
EmailJob.schedule(every: 1.second, email_address: "[email protected]")
128141
```
129142

130-
## Running JoobQ
143+
### Running JoobQ
131144

132145
Starts JoobQ server and listens for jobs
133146

joobq-logo.png

533 KB
Loading

src/joobq.cr

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ module JoobQ
7575
config.queues
7676
end
7777

78-
def statistics
79-
Statistics.instance
80-
end
81-
8278
def push(job)
8379
store.push(job)
8480
end
@@ -105,35 +101,7 @@ module JoobQ
105101
end
106102

107103
Log.info { "JoobQ initialized and waiting for Jobs..." }
108-
spawn do
109-
loop do
110-
print "\e[H\e[2J"
111-
queues.each do |key, queue|
112-
stats = queue.info
113-
message = <<-STATS
114-
Queue: #{key}, Workers: #{queue.total_workers}, Status: #{queue.status}
115-
====================================
116-
Enqueued: #{stats[:enqueued]}
117-
Completed: #{stats[:completed]}
118-
Retried: #{stats[:retried]}
119-
Dead: #{stats[:dead]}
120-
Processing: #{stats[:processing]}
121-
Running Workers: #{stats[:running_workers]}
122-
Jobs per second: #{stats[:jobs_per_second]}
123-
Errors per second: #{stats[:errors_per_second]}
124-
Enqueued per second: #{stats[:enqueued_per_second]}
125-
Jobs latency: #{stats[:jobs_latency]}
126-
127104

128-
STATS
129-
print message
130-
end
131-
132-
# Clear the screen and move the cursor to the top
133-
STDOUT.flush
134-
sleep 3.second
135-
end
136-
end
137105
sleep
138106
end
139107
end

0 commit comments

Comments
 (0)