2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (c) 2017 AT&T Intellectual Property
6 * ===================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * ============LICENSE_END=============================================
20 * ====================================================================
22 package org.onap.music.benchmarks;
24 import javax.ws.rs.GET;
25 import javax.ws.rs.Path;
26 import javax.ws.rs.Produces;
27 import javax.ws.rs.core.MediaType;
28 import org.onap.music.main.MusicUtil;
32 public class MicroBenchMarkRestClient {
33 static double version = 9.7;
37 @Produces(MediaType.TEXT_PLAIN)
38 public String runTests() {
39 String testType = MusicUtil.getTestType();
40 String candidateName = "shankar" + System.currentTimeMillis();
41 MicroBenchMarks msHandle = new MicroBenchMarks();
44 return msHandle.musicPutAndUpdate(candidateName);
46 case "musicCriticalPut":
47 return msHandle.musicCriticalPutAndUpdate(candidateName);
50 return msHandle.musicGet();
53 return msHandle.cassaPutAndUpdate(candidateName);
55 case "cassaQuorumPut":
56 return msHandle.cassaQuorumPutAndUpdate(candidateName);
59 return msHandle.cassaGet();
62 return msHandle.zkPutAndUpdate(candidateName);
65 return msHandle.zkGet();
68 return "something wrong!";