- counters added in order to count the cache hit number and the statistical manager computation number, the cache query sampling hit number and the statistical manager query sampling computation number to perform statistics about the effectiveness of the cache.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@100960 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b6d00aaabc
commit
695e8c423e
|
@ -95,6 +95,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
private static ConcurrentLinkedQueue<DataExchangedThroughQueue> queue = new ConcurrentLinkedQueue<DataExchangedThroughQueue>();
|
||||
private static ThreadDataLoader dataLoader;
|
||||
|
||||
private static int smComputationNumber;
|
||||
private static int cacheHitsNumber;
|
||||
|
||||
private static int smComputationQuerySamplingNumber;
|
||||
private static int cacheQuerySamplingHitsNumber;
|
||||
|
||||
public GWTdbManagerServiceImpl() throws Exception {
|
||||
}
|
||||
|
||||
|
@ -159,6 +165,13 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// create the thread DataLoader
|
||||
dataLoader = new ThreadDataLoader();
|
||||
logger.info("dbmanager-> Thread Dataloader created");
|
||||
|
||||
smComputationNumber = 0;
|
||||
cacheHitsNumber = 0;
|
||||
|
||||
smComputationQuerySamplingNumber = 0;
|
||||
cacheQuerySamplingHitsNumber = 0;
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("dbmanager-> ", e);
|
||||
|
||||
|
@ -287,6 +300,11 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
session.setAttribute("listKeySubmitQueryResult",
|
||||
listKeySubmitQueryResult);
|
||||
|
||||
//print data
|
||||
logger.info("dbmanager-> CheckInformation: cache hits number " + cacheHitsNumber);
|
||||
logger.info("dbmanager-> CheckInformation: SM computation number " + smComputationNumber);
|
||||
logger.info("dbmanager-> CheckInformation: cache Query Sampling hits number " + cacheQuerySamplingHitsNumber);
|
||||
logger.info("dbmanager-> CheckInformation: SM Query Sampling computation number " + smComputationQuerySamplingNumber);
|
||||
}
|
||||
|
||||
// to get resources from IS
|
||||
|
@ -629,6 +647,9 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
if ((data != null) && (submitQueryResult != null)) {
|
||||
result = (SubmitQueryResultWithFileFromServlet) data;
|
||||
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
cacheQuerySamplingHitsNumber++;
|
||||
// set variable to true value if cached data are used and a
|
||||
// computation is not started
|
||||
Boolean val = new Boolean(true);
|
||||
|
@ -636,6 +657,10 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
} else {
|
||||
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
smComputationQuerySamplingNumber++;
|
||||
|
||||
// set variable to false value if cached data are not used and a
|
||||
// computation is started
|
||||
Boolean val = new Boolean(false);
|
||||
|
@ -648,6 +673,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
String computationId = startComputation(algorithmId,
|
||||
inputParameters, outputData, scope, UID);
|
||||
|
||||
|
||||
// get JobID
|
||||
if (checkJob(UID)) { // if the computation has not been removed
|
||||
// the job uid is present
|
||||
|
@ -858,11 +884,16 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
if (value != null) {
|
||||
result = (SamplingResultWithFileFromServlet) value;
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
cacheQuerySamplingHitsNumber++;
|
||||
|
||||
} else {
|
||||
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
smComputationQuerySamplingNumber++;
|
||||
// start computation
|
||||
|
||||
// create data structure
|
||||
ComputationOutput outputData = new ComputationOutput();
|
||||
// computation id
|
||||
|
@ -1012,9 +1043,13 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
if (value != null) {
|
||||
result = (SamplingResultWithFileFromServlet) value;
|
||||
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
cacheQuerySamplingHitsNumber++;
|
||||
} else {
|
||||
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
smComputationQuerySamplingNumber++;
|
||||
// create data structure
|
||||
ComputationOutput outputData = new ComputationOutput();
|
||||
// computation id
|
||||
|
@ -2490,7 +2525,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
if (value != null) {
|
||||
// System.out.println("***GETTING DATA FROM CACHE");
|
||||
outputParameters = (List<FileModel>) value;
|
||||
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
} else {
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
|
||||
// start the computation
|
||||
// System.out.println("***STARTING THE COMPUTATION");
|
||||
|
@ -2571,9 +2611,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
if (value != null) {
|
||||
outputParameters = (LinkedHashMap<String, FileModel>) value;
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
// System.out.println("***GETTING DATA FROM CACHE");
|
||||
} else {
|
||||
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
// start the computation
|
||||
// System.out.println("***STARTING THE COMPUTATION");
|
||||
// create data structure
|
||||
|
@ -2683,7 +2726,11 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
if (value != null) {
|
||||
outputParameters = (List<FileModel>) value;
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
} else {
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
|
||||
// start the computation
|
||||
// create data structure
|
||||
|
@ -2808,9 +2855,13 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
if (value != null) {
|
||||
outputParameters = (List<Result>) value;
|
||||
cacheHitsNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data found in cache. cacheHitsNumber: " + cacheHitsNumber);
|
||||
|
||||
} else {
|
||||
|
||||
smComputationNumber++;
|
||||
logger.info("dbmanager-> CheckDataInCache: data not found in cache. Starting the Statistical Computation. smComputationNumber: " + smComputationNumber);
|
||||
// start computation
|
||||
// create data structure
|
||||
ComputationOutput outputData = new ComputationOutput();
|
||||
|
|
Loading…
Reference in New Issue