Motr  M0
hist__fom_req_r.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_req_r" }
21 
22 def query(from_, to_):
23  q=f"""
24  SELECT (fr.time-fom_req.time) as time, fom_req.state, fr.state, fr.id FROM fom_desc
25  JOIN fom_req on fom_desc.fom_sm_id=fom_req.id and fom_desc.pid=fom_req.pid
26  JOIN fom_req fr ON fr.id=fom_req.id and fr.pid=fom_req.pid
27 
28  WHERE fom_desc.req_opcode LIKE '%READV%'
29  AND fom_req.state="{from_}"
30  AND fr.state="{to_}";
31  """
32  return q
33 
34 if __name__ == '__main__':
35  import sys
36  sys.exit(1)
def query(from_, to_)