|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | from aiomysql.sa import create_engine |
| 16 | +from sqlalchemy import Column, Float, Integer, String |
16 | 17 | from sqlalchemy.orm import declarative_base |
17 | | -from sqlalchemy import Integer, String, Column, Float |
18 | 18 | from sqlalchemy.schema import CreateTable, DropTable |
19 | | - |
20 | 19 | from testing_support.db_settings import mysql_settings |
21 | 20 | from testing_support.util import instance_hostname |
22 | | -from testing_support.validators.validate_database_trace_inputs import ( |
23 | | - validate_database_trace_inputs, |
24 | | -) |
25 | | -from testing_support.validators.validate_transaction_metrics import ( |
26 | | - validate_transaction_metrics, |
27 | | -) |
| 21 | +from testing_support.validators.validate_database_trace_inputs import validate_database_trace_inputs |
| 22 | +from testing_support.validators.validate_transaction_metrics import validate_transaction_metrics |
28 | 23 |
|
29 | 24 | from newrelic.api.background_task import background_task |
30 | 25 |
|
|
38 | 33 |
|
39 | 34 | Base = declarative_base() |
40 | 35 |
|
| 36 | + |
41 | 37 | class ABCModel(Base): |
42 | 38 | __tablename__ = TABLE_NAME |
43 | 39 |
|
44 | 40 | a = Column(Integer, primary_key=True) |
45 | 41 | b = Column(Float) |
46 | 42 | c = Column(String(100)) |
47 | | - |
| 43 | + |
48 | 44 |
|
49 | 45 | ABCTable = ABCModel.__table__ |
50 | 46 |
|
@@ -99,6 +95,7 @@ async def exercise(engine): |
99 | 95 | (f"Datastore/instance/MySQL/{HOST}/{PORT}", 8), |
100 | 96 | ] |
101 | 97 |
|
| 98 | + |
102 | 99 | @validate_transaction_metrics( |
103 | 100 | "test_sqlalchemy:test_execute_via_engine", |
104 | 101 | scoped_metrics=SCOPED_METRICS, |
|
0 commit comments