Motr  M0
hist__fom_to_rpc.py
Go to the documentation of this file.
1 #
2 # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
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 #
16 # For any questions about this software or licensing,
17 # please email opensource@seagate.com or cortx-questions@seagate.com.
18 #
19 
20 attr={ "name": "fom_to_rpc" }
21 
22 def query(from_, to_):
23  q=f"""
24  SELECT (rpc_req.time-fom_req.time), fom_req.state, rpc_req.state
25  FROM fom_desc
26  JOIN fom_req on fom_req.id=fom_sm_id
27  JOIN rpc_req on rpc_req.id=rpc_sm_id
28  WHERE fom_desc.req_opcode LIKE "%M0_IOSERVICE_%"
29  AND rpc_req.pid=fom_req.pid
30  AND rpc_req.state="{to_}" AND fom_req.state="{from_}";
31  """
32  return q
33 
34 if __name__ == '__main__':
35  import sys
36  sys.exit(1)
def query(from_, to_)