summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2018-03-21 21:08:20 +0000
committerBernard Gorman <bernard.gorman@gmail.com>2018-03-22 03:36:43 +0000
commit40d59f4bc8eec0fc585edec0f2c8833f09a4a853 (patch)
treef5654a7274c4925ad3be8d46e305f8478894c445 /buildscripts
parentb7178eca18c1a56b05eb206fa9d202345c128df5 (diff)
downloadmongo-40d59f4bc8eec0fc585edec0f2c8833f09a4a853.tar.gz
SERVER-14900 Log operations that exceed slowMs on mongoS
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/idl/idl/generator.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index c76cae52e15..3433ecde702 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -1098,7 +1098,16 @@ class _CppSourceFileWriter(_CppFileWriterBase):
ast.Command) and struct.namespace != common.COMMAND_NAMESPACE_IGNORED:
if struct.namespace == common.COMMAND_NAMESPACE_TYPE:
cpp_type_info = cpp_types.get_cpp_type(struct.command_field)
- self._writer.write_line('%s localCmdType;' % (cpp_type_info.get_storage_type()))
+
+ if struct.command_field.cpp_type and cpp_types.is_primitive_scalar_type(
+ struct.command_field.cpp_type):
+ self._writer.write_line('%s localCmdType(%s);' %
+ (cpp_type_info.get_storage_type(),
+ cpp_types.get_primitive_scalar_type_default_value(
+ struct.command_field.cpp_type)))
+ else:
+ self._writer.write_line('%s localCmdType;' %
+ (cpp_type_info.get_storage_type()))
self._writer.write_line('%s object(localCmdType);' %
(common.title_case(struct.cpp_name)))
elif struct.namespace == common.COMMAND_NAMESPACE_CONCATENATE_WITH_DB: