Skip to content

Commit

Permalink
Add a concurrent connections threshold configuration parameter to Sta…
Browse files Browse the repository at this point in the history
…rgate applications.

This new configuration option will end up controlling the #maximumNumberOfConcurrentConnections parameter in Zinc.
  • Loading branch information
gcotelli committed Mar 21, 2024
1 parent 280164f commit ffc4382
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
- don't 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 ffc4382

Please sign in to comment.