khenaidoo | bf6e7bb | 2018-08-14 22:27:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Stephane Barbarie | 4a2564d | 2018-07-26 11:02:58 -0400 | [diff] [blame] | 16 | package model |
| 17 | |
Stephane Barbarie | 4a2564d | 2018-07-26 11:02:58 -0400 | [diff] [blame] | 18 | var ( |
Stephane Barbarie | 88fbe7f | 2018-09-25 12:25:23 -0400 | [diff] [blame] | 19 | backend *Backend |
| 20 | rootPrefix = "service/voltha/data/core/0001" |
Stephane Barbarie | 4a2564d | 2018-07-26 11:02:58 -0400 | [diff] [blame] | 21 | |
Stephane Barbarie | 88fbe7f | 2018-09-25 12:25:23 -0400 | [diff] [blame] | 22 | //basePrefix = "service/voltha/service/vcores/data/devices" |
| 23 | deviceId = "00016f13befaedcc" |
| 24 | //rootPrefix = basePrefix + "/" + deviceId |
Stephane Barbarie | 4a2564d | 2018-07-26 11:02:58 -0400 | [diff] [blame] | 25 | deviceProxy = "/devices/" + deviceId |
| 26 | ) |
| 27 | |
Stephane Barbarie | 933b09b | 2019-01-09 11:12:09 -0500 | [diff] [blame] | 28 | //func Test_NewRoot(t *testing.T) { |
| 29 | // backend = NewBackend(ETCD_KV, etcd_host, etcd_port, timeout, rootPrefix) |
| 30 | // |
| 31 | // var msgClass *voltha.Voltha |
| 32 | // //var msgClass *voltha.DeviceInstance |
| 33 | // root := NewRoot(msgClass, backend) |
| 34 | // |
| 35 | // start := time.Now() |
| 36 | // |
| 37 | // //r := root.Load(msgClass) |
| 38 | // afterLoad := time.Now() |
| 39 | // log.Infof(">>>>>>>>>>>>> Time to Load : %f\n", afterLoad.Sub(start).Seconds()) |
| 40 | // |
| 41 | // d := r.node.Get(deviceProxy, "", 0, false, "") |
| 42 | // afterGet := time.Now() |
| 43 | // log.Infof(">>>>>>>>>>>>> Time to Load and get: %f\n", afterGet.Sub(start).Seconds()) |
| 44 | // |
| 45 | // jr, _ := json.Marshal(r) |
| 46 | // log.Infof("Content of ROOT --> \n%s\n", jr) |
| 47 | // |
| 48 | // jd, _ := json.Marshal(d) |
| 49 | // log.Infof("Content of GET --> \n%s\n", jd) |
| 50 | // |
| 51 | //} |