Skip to content

Commit

Permalink
Merge pull request #184 from ba-st/max_connections_configuration
Browse files Browse the repository at this point in the history
Add a concurrent connections threshold configuration parameter
  • Loading branch information
gcotelli authored Mar 22, 2024
2 parents 280164f + 1f7454b commit b4104fd
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"
I'm a testing application used to check the concurrent connections threshold configuration parameter behavior.
"
Class {
#name : 'ConcurrentConnectionsTestApplication',
#superclass : 'StargateApplication',
#category : 'Stargate-API-Skeleton-Tests',
#package : 'Stargate-API-Skeleton-Tests'
}

{ #category : 'accessing' }
ConcurrentConnectionsTestApplication class >> commandName [

^ 'concurrent-connections-test'
]

{ #category : 'accessing' }
ConcurrentConnectionsTestApplication class >> description [

^'A Test API making the request processing to wait a certain amount of time'
]

{ #category : 'initialization' }
ConcurrentConnectionsTestApplication class >> initialize [

<ignoreForCoverage>
self initializeVersion
]

{ #category : 'private' }
ConcurrentConnectionsTestApplication class >> projectName [

^ 'Stargate'
]

{ #category : 'private - accessing' }
ConcurrentConnectionsTestApplication >> controllersToInstall [

^ { DelayedRESTfulController new }
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"
I'm a example of a RESTful controller:
- only implementing GET operations
- not paginating collections
- not using hypermedia
"
Class {
#name : 'DelayedRESTfulController',
#superclass : 'SingleResourceRESTfulController',
#instVars : [
'requestHandler'
],
#category : 'Stargate-API-Skeleton-Tests',
#package : 'Stargate-API-Skeleton-Tests'
}

{ #category : 'routes' }
DelayedRESTfulController >> declareWaitRoute [

^ RouteSpecification handling: #GET at: self endpoint evaluating: [ :httpRequest :requestContext |
100 milliSeconds wait.
ZnResponse ok: ( ZnEntity text: 'OK' )
]
]

{ #category : 'initialization' }
DelayedRESTfulController >> initialize [

super initialize.
requestHandler := RESTfulRequestHandlerBuilder new
handling: 'wait';
createEntityTagHashingEncodedResource;
build
]

{ #category : 'private' }
DelayedRESTfulController >> requestHandler [

^ requestHandler
]

{ #category : 'private' }
DelayedRESTfulController >> typeIdConstraint [

^ IsObject
]
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
Class {
#name : #StargateApplicationStackTraceDumperTest,
#superclass : #TestCase,
#category : #'Stargate-API-Skeleton-Tests'
#name : 'StargateApplicationStackTraceDumperTest',
#superclass : 'TestCase',
#category : 'Stargate-API-Skeleton-Tests',
#package : 'Stargate-API-Skeleton-Tests'
}

{ #category : #accessing }
{ #category : 'accessing' }
StargateApplicationStackTraceDumperTest class >> defaultTimeLimit [

^5 minute
]

{ #category : #running }
{ #category : 'running' }
StargateApplicationStackTraceDumperTest >> setUp [

super setUp.
StargateApplication logsDirectory ensureCreateDirectory
]

{ #category : #'tests - application' }
{ #category : 'tests - application' }
StargateApplicationStackTraceDumperTest >> testStackTraceDumper [

| dumper result |
Expand Down
Loading

0 comments on commit b4104fd

Please sign in to comment.