-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththoughtstream-experiment.R
54 lines (40 loc) · 1.46 KB
/
thoughtstream-experiment.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 3.2.10
# Goal: predict thoughtstream's 99th percentile latency using its own op models.
# Initialize experiment params
startingThread=51
endingThread=100
basePath="/work/ksauer/2.12.10-thoughtstream-experiment"
numValidationRuns=10
latencyQuantile=0.99
queryType="thoughtstream"
numSampleSets=numValidationRuns
## Training Phase
trainingData = getTrainingData(startingThread, endingThread, basePath)
createAndSaveThoughtstreamOpHistograms(basePath)
# Sanity Check
dim(trainingData)
numQueries = length(which(trainingData$opLevel==3))
numQueries
## Validation Phase
getValidationStats(startingThread, endingThread, basePath, numValidationRuns, latencyQuantile)
getPredictedQueryLatencyQuantiles(queryType, numSampleSets, basePath, latencyQuantile)
getPredictionError(basePath)
## VERSION 2: using "queryExperiment1" function
basePath="/work/ksauer/2.12.10-thoughtstream-experiment"
# Initialize experiment params
startingThread=51
endingThread=100
numValidationRuns=10
latencyQuantile=0.99
queryType="thoughtstream"
numSampleSets=numValidationRuns
# Save to paramFile
save(startingThread, endingThread, numValidationRuns, latencyQuantile, queryType, numSampleSets, file=paste(basePath, "/paramFile.RData", sep=""))
# Run experiment
#source(file="queryExperiment1.R")
error = queryExperiment1(basePath)
print(error)
# Just get error
source("/work/ksauer/scads/experiments/client/performance/logparsing/src/main/R/experiment-functions.R")
error = getPredictionError(basePath)
error