Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
d850c441
Commit
d850c441
authored
Mar 06, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some load test examples
parent
7a37ea46
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
0 deletions
+26
-0
Rakefile
Rakefile
+5
-0
noah-watcher.rb
bin/noah-watcher.rb
+1
-0
cluster.ru
examples/cluster.ru
+2
-0
httpclient-server.rb
examples/httpclient-server.rb
+1
-0
simple-post.rb
examples/simple-post.rb
+17
-0
No files found.
Rakefile
View file @
d850c441
...
...
@@ -28,6 +28,11 @@ task :sample, :redis_url do |t, args|
Ohm
::
connect
(
:url
=>
args
.
redis_url
)
Ohm
::
redis
.
flushdb
puts
"Creating watchers..."
Noah
::
Watcher
.
create
:endpoint
=>
"http://localhost:3000/webhook"
,
:pattern
=>
"//noah/application"
Noah
::
Watcher
.
create
:endpoint
=>
"http://localhost:3001/webhook"
,
:pattern
=>
"//noah/configuration"
Noah
::
Watcher
.
create
:endpoint
=>
"http://localhost:3002/webhook"
,
:pattern
=>
"//noah/host"
Noah
::
Watcher
.
create
:endpoint
=>
"http://localhost:3003/webhook"
,
:pattern
=>
"//noah/service"
puts
"Creating Host entry for 'localhost'"
h
=
Noah
::
Host
.
create
(
:name
=>
'localhost'
,
:status
=>
"up"
)
if
h
.
save
...
...
bin/noah-watcher.rb
View file @
d850c441
#!/usr/bin/env ruby
$:
.
unshift
(
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
,
"lib"
)))
require
'rubygems'
require
'rbtrace'
require
'logger'
require
'optparse'
require
'em-hiredis'
...
...
examples/cluster.ru
0 → 100644
View file @
d850c441
require
'./simple-post.rb'
run
NoahPostDemo
examples/httpclient-server.rb
100644 → 100755
View file @
d850c441
#!/usr/bin/env ruby
require
'sinatra'
require
'json'
post
'/webhook'
do
...
...
examples/simple-post.rb
0 → 100644
View file @
d850c441
require
'sinatra/base'
require
'json'
class
NoahPostDemo
<
Sinatra
::
Base
configure
do
set
:app_file
,
__FILE__
set
:server
,
%w[thin]
set
:logging
,
true
set
:run
,
true
end
post
'/webhook/?'
do
x
=
request
.
body
.
read
p
JSON
.
load
(
x
)
end
end
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