Skip to content

Commit

Permalink
Issue #157 feat: adding benchmarking support
Browse files Browse the repository at this point in the history
  • Loading branch information
steotia committed Jul 2, 2018
1 parent 2940b23 commit 7a5ff23
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 0 deletions.
24 changes: 24 additions & 0 deletions benchmarking/gatling/AddSimulation.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package opensaber.write // 1

import io.gatling.core.Predef._ // 2
import io.gatling.http.Predef._
import scala.concurrent.duration._

class BasicSimulation extends Simulation { // 3

val httpConf = http // 4
.baseURL("http://localhost:8080") // 5
.header("Content-Type", "application/json")

val scn = scenario("BasicSimulation") // 7
.exec(
http("request_1") // 8
.post("/add")
.body(RawFileBody("opensaber/feeders/teacher.jsonld")).asJSON
)
.pause(5) // 10

setUp( // 11
scn.inject(rampUsers(150) over (10 seconds)) // 12
).protocols(httpConf) // 13
}
145 changes: 145 additions & 0 deletions benchmarking/gatling/feeders/teacher.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"id":"open-saber.registry.create",
"ver":"1.0",
"ets":"11234",
"params":{
"did":"",
"key":"",
"msgid":""
},
"request":{
"@context":{
"rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs":"http://www.w3.org/2000/01/rdf-schema#",
"teacher":"http://localhost:8080/",
"xsd":"http://www.w3.org/2001/XMLSchema#",
"@vocab":"http://localhost:8080/",
"gender":{
"@type":"@id"
}
},
"@type":"Teacher",
"serialNum":12,
"teacherCode":"12234",
"nationalIdentifier":"1234567890123456",
"teacherName":"Marvin Pande",
"gender":"teacher:GenderTypeCode-MALE",
"birthDate":{
"@type":"xsd:date",
"@value":"1990-12-06"
},
"socialCategory":{
"@id":"teacher:SocialCategoryTypeCode-GENERAL"
},
"highestAcademicQualification":{
"@id":"teacher:AcademicQualificationTypeCode-PHD"
},
"highestTeacherQualification":{
"@id":"teacher:TeacherQualificationTypeCode-MED"
},
"yearOfJoiningService":{
"@type":"xsd:gYear",
"@value":"2014"
},
"teachingRole":{
"@type":"TeachingRole",
"teacherType":{
"@id":"teacher:TeacherTypeCode-HEAD"
},
"appointmentType":{
"@id":"teacher:TeacherAppointmentTypeCode-REGULAR"
},
"classesTaught":{
"@id":"teacher:ClassTypeCode-SECONDARYANDHIGHERSECONDARY"
},
"appointedForSubjects":{
"@id":"teacher:SubjectCode-MATH"
},
"mainSubjectsTaught":[
{
"@id":"teacher:SubjectCode-PHYSICS"
},
{
"@id":"teacher:SubjectCode-MATH"
}
],
"appointmentYear":{
"@type":"xsd:gYear",
"@value":"2015"
}
},
"inServiceTeacherTrainingFromBRC":{
"@type":"InServiceTeacherTrainingFromBlockResourceCentre",
"teacher:daysOfInServiceTeacherTraining":{
"@type":"xsd:decimal",
"@value":"10"
}
},
"inServiceTeacherTrainingFromCRC":{
"@type":"InServiceTeacherTrainingFromClusterResourceCentre",
"teacher:daysOfInServiceTeacherTraining":{
"@type":"xsd:decimal",
"@value":"2"
}
},
"inServiceTeacherTrainingFromDIET":{
"@type":"InServiceTeacherTrainingFromDIET",
"teacher:daysOfInServiceTeacherTraining":{
"@type":"xsd:decimal",
"@value":"5.5"
}
},
"inServiceTeacherTrainingFromOthers":{
"@type":"InServiceTeacherTrainingFromOthers",
"teacher:daysOfInServiceTeacherTraining":{
"@type":"xsd:decimal",
"@value":"3.5"
}
},
"nonTeachingAssignmentsForAcademicCalendar":{
"@type":"NonTeachingAssignmentsForAcademicCalendar",
"teacher:daysOfNonTeachingAssignments":{
"@type":"xsd:decimal",
"@value":"6"
}
},
"basicProficiencyLevel":[
{
"@type":"BasicProficiencyLevel",
"proficiencySubject":{
"@id":"teacher:SubjectCode-MATH"
},
"proficiencyAcademicQualification":{
"@id":"teacher:AcademicQualificationTypeCode-PHD"
}
},
{
"@type":"BasicProficiencyLevel",
"proficiencySubject":{
"@id":"teacher:SubjectCode-ENGLISH"
},
"proficiencyAcademicQualification":{
"@id":"teacher:AcademicQualificationTypeCode-HIGHERSECONDARY"
}
},
{
"@type":"BasicProficiencyLevel",
"proficiencySubject":{
"@id":"teacher:SubjectCode-SOCIALSTUDIES"
},
"proficiencyAcademicQualification":{
"@id":"teacher:AcademicQualificationTypeCode-SECONDARY"
}
}
],
"disabilityType":{
"@id":"teacher:DisabilityCode-NA"
},
"trainedForChildrenSpecialNeeds":{
"@id":"teacher:YesNoCode-YES"
},
"teacher:trainedinUseOfComputer":{
"@id":"teacher:YesNoCode-YES"
}
}
}

0 comments on commit 7a5ff23

Please sign in to comment.