The application uses only one database, named test_suite
There are three collections in the test_suite database
This collection holds the dynamically registered client information when a user logs into the test suite using something other than Google. (I.E. user@mitreid.org)
_id: This is the ID of the client, it is the same as the 'issuer' (e.g.https://mitreid.org
_class: This is the class used by Spring to represent this information, should becom.mongodb.BasicDBObject
client_json: This contains the serialized JSON for the client registration.
time: NumberLong timestamp for the entry
Since this collection is only searched by the issuer (_id) The default index on the _id field is sufficent.
This collection contains information about each test instance in the framework.
_id: Id field, random string
_class: Java class used by Spring to represent this data (should becom.mongodb.BasicDBObject)
testId: Same as_id?
testName: This is the name of the test being run. (What type of test is being run)
started: Timestamp of when the test was started
config: This contains a structure that is the configuration for the test being run. the contents of this sub document depend on the test.
alias: Alias for this test. A non-unique name that can be attached to the particular instance of a test.
owner: The owner of the test, it is a sub document with thesubandissproperties of the user. ('subject' and 'issuer' related to how they logged in.
status: Current Status of the test, a String value.
result: Final result of the test.
/info Request Mapping:
If the user is an admin, it is just a
.find()of all objects. If the user isn't an admin, theownerfield is used, since this is a majority of the cases, an index on justownercould be useful
/info/{id} RequestMapping:
As an admin, the query hits just the
_idfield, so the default index is sufficant. As a non-admin, the query hits both_idandowner, HOWEVER since_idis unique and already indexed, MongoDB will use the_idindex to find the document first, then compair theownerto it. This means adding a compound index won't be helpful.
The only queries of note in the DBTestInfoService are the update operations which are performed on documents based on _id (and sometimes owner), thus the default index is fine here.
####EVENT_LOG Collection
_id: Id field, made up from thetestIdplus a-and a long string of random chars
_class: Java class used by Spring to represent this data (should becom.mongodb.BasicDBObject)
testId: Same as_id?
testName: This is the name of the test being run. (What type of test is being run)
started: Timestamp of when the test was started
alias: Alias for this test. A non-unique name that can be attached to the particular instance of a test.
testOwner: The owner of the test, it is a sub document with thesubandissproperties of the user. ('subject' and 'issuer' related to how they logged in.
src: Where the log came from.
/log Request Mapping:
testOwneris used to filter documents if the user is not an admin (so an index ontestOwnercould be helpfulThere is a call to get distinct
testIds using thetestOwnerfilter from above. There can perhaps be a better way to deal with this index wise. DO MORE RESEARCH
/log/{id} Request Mapping:
The main filter being done here is on
testIdso an index on that could help immensly. AddtionallytestOwneris used, but that can be fufilled by an index ontestOwneralone. (from above...) Additionally a.sort()is done on thetimefield. Again an index will speed this operation.
The updates performed here use the testId field for the main searching. (Along with placeholders, etc. But since all queries use testId an index on that should be the most bennificial.)
Along with the default _id index that is on all collections, the following indices could be added to speed performance.
OIDC_REGISTERED_CLIENTS
None. Only the
_idfield is used.
TEST_INFO
ownerThis is used quite often to limit results, so creating an index on this field would be most helpful
EVENT_LOG
testOwneris used when preparing the list of log entriestestIdis used extensivly (this is used in the 'distinct' call as well)timeis used to sort fields along withtestId